|
@@ -2,8 +2,7 @@ package com.ruoyi.basicData.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
-import com.ruoyi.common.core.domain.entity.TWarehouse;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.ruoyi.basicData.domain.TWarehouseArea;
|
|
|
import com.ruoyi.basicData.mapper.TWarehouseAreaMapper;
|
|
|
import com.ruoyi.basicData.mapper.TWarehouseMapper;
|
|
@@ -11,11 +10,18 @@ import com.ruoyi.basicData.service.ITWarehouseService;
|
|
|
import com.ruoyi.common.constant.UserConstants;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.TreeSelect;
|
|
|
+import com.ruoyi.common.core.domain.entity.TWarehouse;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
import com.ruoyi.common.exception.CustomException;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
|
|
|
import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.enums.AnnexActEnum;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;
|
|
|
+import com.ruoyi.warehouseBusiness.mapper.TAnnexMapper;
|
|
|
import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -35,6 +41,9 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
@Autowired
|
|
|
+ private TAnnexMapper annexMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private TWarehouseMapper tWarehouseMapper;
|
|
|
|
|
|
@Autowired
|
|
@@ -51,8 +60,17 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
* @return 仓库
|
|
|
*/
|
|
|
@Override
|
|
|
- public TWarehouse selectTWarehouseById(Long fId) {
|
|
|
- return tWarehouseMapper.selectTWarehouseById(fId);
|
|
|
+ public WarehouseInfoVO selectTWarehouseById(Long fId) {
|
|
|
+ WarehouseInfoVO warehouseInfoVO = new WarehouseInfoVO();
|
|
|
+ TWarehouse tWarehouse = tWarehouseMapper.selectTWarehouseById(fId);
|
|
|
+ if (Objects.nonNull(tWarehouse)) {
|
|
|
+ TAnnex annex = new TAnnex();
|
|
|
+ annex.setfPid(tWarehouse.getfId());
|
|
|
+ annex.setfActid(AnnexActEnum.WAREHOUSE.getType());
|
|
|
+ List<TAnnex> annexList = annexMapper.selectTAnnexList(annex);
|
|
|
+ warehouseInfoVO.setAnnexList(annexList);
|
|
|
+ }
|
|
|
+ return warehouseInfoVO;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -62,9 +80,9 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
if (StringUtils.isNotNull(tWarehouse)) {
|
|
|
map.put("tWarehouse", tWarehouse);
|
|
|
}
|
|
|
- TWarehouseArea tWarehouseArea= new TWarehouseArea();
|
|
|
+ TWarehouseArea tWarehouseArea = new TWarehouseArea();
|
|
|
tWarehouseArea.setfWarehouseid(fId);
|
|
|
- List<TWarehouseArea> tWarehouseAreaList =tWarehouseAreaMapper.selectTWarehouseAreaList(tWarehouseArea);
|
|
|
+ List<TWarehouseArea> tWarehouseAreaList = tWarehouseAreaMapper.selectTWarehouseAreaList(tWarehouseArea);
|
|
|
if (StringUtils.isNotEmpty(tWarehouseAreaList)) {
|
|
|
map.put("tWarehouseArea", tWarehouseAreaList);
|
|
|
}
|
|
@@ -104,11 +122,11 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
}
|
|
|
tWarehouse.setAncestors(info.getAncestors() + "," + tWarehouse.getParentId());
|
|
|
// 所有节点转换成中文拼接
|
|
|
- String fWarehouseInformation = warehouseName(info.getAncestors() + "," + tWarehouse.getParentId(),tWarehouse.getfName());
|
|
|
+ String fWarehouseInformation = warehouseName(info.getAncestors() + "," + tWarehouse.getParentId(), tWarehouse.getfName());
|
|
|
tWarehouse.setfWarehouseInformation(fWarehouseInformation);
|
|
|
tWarehouseMapper.insertTWarehouse(tWarehouse);
|
|
|
// 更新库容
|
|
|
- if (tWarehouse.getfLocation()==1){
|
|
|
+ if (tWarehouse.getfLocation() == 1) {
|
|
|
int i = updateWarehousefTotalgross(tWarehouse.getAncestors());
|
|
|
if (i <= 0) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
@@ -125,7 +143,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
if (StringUtils.isEmpty(tWarehouse)) {
|
|
|
return AjaxResult.error("提交失败:仓库信息为空");
|
|
|
}
|
|
|
- if ( StringUtils.isEmpty(tWarehouseArea) && !"[{}]".equals(tWarehouseArea) ) {
|
|
|
+ if (StringUtils.isEmpty(tWarehouseArea) && !"[{}]".equals(tWarehouseArea)) {
|
|
|
return AjaxResult.error("提交失败:库区为空");
|
|
|
}
|
|
|
Long fPid = null;
|
|
@@ -137,16 +155,16 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
tWarehouses.setCreateTime(new Date());
|
|
|
tWarehouses.setfStatus("0");
|
|
|
tWarehouseMapper.insertTWarehouse(tWarehouses);
|
|
|
- fPid=tWarehouses.getfId();
|
|
|
+ fPid = tWarehouses.getfId();
|
|
|
} else {
|
|
|
- fPid=tWarehouses.getfId();
|
|
|
+ fPid = tWarehouses.getfId();
|
|
|
tWarehouses.setUpdateBy(loginUser.getUser().getUserName());
|
|
|
tWarehouses.setUpdateTime(new Date());
|
|
|
- if(tWarehouses.getfStatus()!=null && tWarehouses.getfStatus().equals("1") ){
|
|
|
- TWarehouseBills tWarehouseBill =new TWarehouseBills();
|
|
|
+ if (tWarehouses.getfStatus() != null && tWarehouses.getfStatus().equals("1")) {
|
|
|
+ TWarehouseBills tWarehouseBill = new TWarehouseBills();
|
|
|
tWarehouseBill.setfWarehouseid(tWarehouses.getfId());
|
|
|
- List<TWarehouseBills> tWarehouseBillList=tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
|
|
|
- if(tWarehouseBillList!=null && !tWarehouseBillList.isEmpty()){
|
|
|
+ List<TWarehouseBills> tWarehouseBillList = tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
|
|
|
+ if (tWarehouseBillList != null && !tWarehouseBillList.isEmpty()) {
|
|
|
return AjaxResult.error("仓库在库存总账有记录不可变更状态");
|
|
|
}
|
|
|
}
|
|
@@ -154,13 +172,13 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
// tWarehouseAreaMapper.deleteTWarehouseAreaByTWarehoused(fPid);
|
|
|
}
|
|
|
for (TWarehouseArea cc : tWarehouseAreaList) {
|
|
|
- if( StringUtils.isNull(cc.getfNo()) ||
|
|
|
- StringUtils.isNull(cc.getfName()) ||
|
|
|
- StringUtils.isNull(cc.getfAddr()) ){
|
|
|
+ if (StringUtils.isNull(cc.getfNo()) ||
|
|
|
+ StringUtils.isNull(cc.getfName()) ||
|
|
|
+ StringUtils.isNull(cc.getfAddr())) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return AjaxResult.error("请完善库区明细信息");
|
|
|
}
|
|
|
- if(cc.getfId()!=null){
|
|
|
+ if (cc.getfId() != null) {
|
|
|
cc.setUpdateBy(loginUser.getUser().getUserName());
|
|
|
cc.setUpdateTime(new Date());
|
|
|
tWarehouseAreaMapper.updateTWarehouseArea(cc);
|
|
@@ -185,11 +203,11 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public AjaxResult updateTWarehouse(TWarehouse tWarehouse) {
|
|
|
- if(tWarehouse.getfStatus()!=null && tWarehouse.getfStatus().equals("1") ){
|
|
|
- TWarehouseBills tWarehouseBill =new TWarehouseBills();
|
|
|
+ if (tWarehouse.getfStatus() != null && tWarehouse.getfStatus().equals("1")) {
|
|
|
+ TWarehouseBills tWarehouseBill = new TWarehouseBills();
|
|
|
tWarehouseBill.setfWarehouseid(tWarehouse.getfId());
|
|
|
- List<TWarehouseBills> tWarehouseBillList=tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
|
|
|
- if(tWarehouseBillList!=null && !tWarehouseBillList.isEmpty()){
|
|
|
+ List<TWarehouseBills> tWarehouseBillList = tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
|
|
|
+ if (tWarehouseBillList != null && !tWarehouseBillList.isEmpty()) {
|
|
|
return AjaxResult.error("仓库在库存总账有记录不可变更状态");
|
|
|
}
|
|
|
}
|
|
@@ -208,7 +226,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
tWarehouse.setAncestors(newAncestors);
|
|
|
updateDeptChildren(tWarehouse.getfId(), newAncestors, oldAncestors);
|
|
|
// 修改仓库信息
|
|
|
- String fWarehouseInformation = warehouseName(newAncestors,tWarehouse.getfName());
|
|
|
+ String fWarehouseInformation = warehouseName(newAncestors, tWarehouse.getfName());
|
|
|
tWarehouse.setfWarehouseInformation(fWarehouseInformation);
|
|
|
}
|
|
|
int result = tWarehouseMapper.updateTWarehouse(tWarehouse);
|
|
@@ -217,7 +235,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
updateParentDeptStatus(tWarehouse);
|
|
|
}
|
|
|
// 更新库容
|
|
|
- if (tWarehouse.getfLocation()==1){
|
|
|
+ if (tWarehouse.getfLocation() == 1) {
|
|
|
int i = updateWarehousefTotalgross(tWarehouse.getAncestors());
|
|
|
if (i <= 0) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
@@ -267,11 +285,11 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
public AjaxResult deleteTWarehouseByIds(Long[] fIds) {
|
|
|
// 查询仓库主表 是否有仓库在使用
|
|
|
int i = 1;
|
|
|
- for(Long id:fIds){
|
|
|
- TWarehouseBills tWarehouseBill =new TWarehouseBills();
|
|
|
+ for (Long id : fIds) {
|
|
|
+ TWarehouseBills tWarehouseBill = new TWarehouseBills();
|
|
|
tWarehouseBill.setfWarehouseid(id);
|
|
|
- List<TWarehouseBills> tWarehouseBillList=tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
|
|
|
- if(tWarehouseBillList!=null && !tWarehouseBillList.isEmpty()){
|
|
|
+ List<TWarehouseBills> tWarehouseBillList = tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
|
|
|
+ if (tWarehouseBillList != null && !tWarehouseBillList.isEmpty()) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return AjaxResult.error("仓库第" + i + "行仓库有货物不可删除");
|
|
|
}
|
|
@@ -291,7 +309,9 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public int deleteTWarehouseById(Long fId) {
|
|
|
- return tWarehouseMapper.deleteTWarehouseById(fId);
|
|
|
+ tWarehouseMapper.deleteTWarehouseById(fId);
|
|
|
+ annexMapper.deleteByPid(fId, AnnexActEnum.WAREHOUSE.getType());
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -322,10 +342,73 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
return result > 0 ? true : false;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增仓库
|
|
|
+ *
|
|
|
+ * @param tWarehouse
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AjaxResult warehouseSubmit(WarehouseSubmitDTO tWarehouse) {
|
|
|
+ // 登录用户
|
|
|
+ String username = SecurityUtils.getUsername();
|
|
|
+ tWarehouse.setCreateTime(new Date());
|
|
|
+ tWarehouse.setCreateBy(username);
|
|
|
+ tWarehouseMapper.insertTWarehouse(tWarehouse);
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(tWarehouse.getAnnexList())) {
|
|
|
+ tWarehouse.getAnnexList().forEach(li -> {
|
|
|
+ li.setfPid(tWarehouse.getfId());
|
|
|
+ li.setfActid(AnnexActEnum.WAREHOUSE.getType());
|
|
|
+ if (Objects.nonNull(li.getfId())) {
|
|
|
+ li.setCreateTime(new Date());
|
|
|
+ li.setCreateBy(username);
|
|
|
+ } else {
|
|
|
+ li.setUpdateTime(new Date());
|
|
|
+ li.setUpdateBy(username);
|
|
|
+ }
|
|
|
+ annexMapper.insertTAnnex(li);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改仓库
|
|
|
+ *
|
|
|
+ * @param tWarehouse
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public AjaxResult edit(WarehouseSubmitDTO tWarehouse) {
|
|
|
+ // 登录用户
|
|
|
+ String username = SecurityUtils.getUsername();
|
|
|
+
|
|
|
+ tWarehouse.setUpdateBy(username);
|
|
|
+ tWarehouseMapper.updateTWarehouse(tWarehouse);
|
|
|
+ annexMapper.deleteByPid(tWarehouse.getfId(), AnnexActEnum.WAREHOUSE.getType());
|
|
|
+ if (CollectionUtils.isNotEmpty(tWarehouse.getAnnexList())) {
|
|
|
+ tWarehouse.getAnnexList().forEach(li -> {
|
|
|
+ li.setfPid(tWarehouse.getfId());
|
|
|
+ li.setfActid(AnnexActEnum.WAREHOUSE.getType());
|
|
|
+ if (Objects.nonNull(li.getfId())) {
|
|
|
+ li.setCreateTime(new Date());
|
|
|
+ li.setCreateBy(username);
|
|
|
+ } else {
|
|
|
+ li.setUpdateTime(new Date());
|
|
|
+ li.setUpdateBy(username);
|
|
|
+ }
|
|
|
+ annexMapper.insertTAnnex(li);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public String checkUFNoUnique(TWarehouse tWarehouse) {
|
|
|
TWarehouse tWarehouse1 = tWarehouseMapper.checkFNoUnique(tWarehouse.getfNo());
|
|
|
- if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {
|
|
|
+ if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId() != tWarehouse.getfId()) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -334,7 +417,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
@Override
|
|
|
public String checkUFNnameUnique(TWarehouse tWarehouse) {
|
|
|
TWarehouse tWarehouse1 = tWarehouseMapper.checkUFNnameUnique(tWarehouse.getfName());
|
|
|
- if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {
|
|
|
+ if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId() != tWarehouse.getfId()) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -343,7 +426,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
@Override
|
|
|
public String checkUFAaddrUnique(TWarehouse tWarehouse) {
|
|
|
TWarehouse tWarehouse1 = tWarehouseMapper.checkUFAaddrUnique(tWarehouse.getfAddr());
|
|
|
- if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {
|
|
|
+ if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId() != tWarehouse.getfId()) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -351,8 +434,8 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
|
|
|
@Override
|
|
|
public String checkUFTWarehouseAreaNoUnique(TWarehouseArea tWarehouseAreas) {
|
|
|
- TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkFNoUnique(tWarehouseAreas.getfNo(),tWarehouseAreas.getfWarehouseid());
|
|
|
- if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId()!=tWarehouseAreas.getfId()) {
|
|
|
+ TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkFNoUnique(tWarehouseAreas.getfNo(), tWarehouseAreas.getfWarehouseid());
|
|
|
+ if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId() != tWarehouseAreas.getfId()) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -360,8 +443,8 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
|
|
|
@Override
|
|
|
public String checkUTWarehouseAreaFNnameUnique(TWarehouseArea tWarehouseAreas) {
|
|
|
- TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkUFNnameUnique(tWarehouseAreas.getfName(),tWarehouseAreas.getfWarehouseid());
|
|
|
- if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId()!=tWarehouseAreas.getfId()) {
|
|
|
+ TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkUFNnameUnique(tWarehouseAreas.getfName(), tWarehouseAreas.getfWarehouseid());
|
|
|
+ if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId() != tWarehouseAreas.getfId()) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -408,7 +491,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
@Override
|
|
|
public String checkUFAreUnique(TWarehouse tWarehouse) {
|
|
|
TWarehouseArea tWarehouseArea = tWarehouseAreaMapper.selectTWarehouseAreaByWarehouseId(tWarehouse.getParentId());
|
|
|
- if (StringUtils.isNotNull(tWarehouseArea) ) {
|
|
|
+ if (StringUtils.isNotNull(tWarehouseArea)) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -450,46 +533,47 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
|
|
|
return getChildList(list, t).size() > 0 ? true : false;
|
|
|
}
|
|
|
|
|
|
- public String warehouseName(String ancestors,String oldName){
|
|
|
+ public String warehouseName(String ancestors, String oldName) {
|
|
|
String str[] = ancestors.split(",");
|
|
|
String fWarehouseInformation = "";
|
|
|
- for (String id: str){
|
|
|
- if(!(id.equals("0")) && !(id.equals("100"))){
|
|
|
+ for (String id : str) {
|
|
|
+ if (!(id.equals("0")) && !(id.equals("100"))) {
|
|
|
// 查询仓库名称
|
|
|
- TWarehouse tWarehouse=tWarehouseMapper.selectTWarehouseById(Long.valueOf(id));
|
|
|
+ TWarehouse tWarehouse = tWarehouseMapper.selectTWarehouseById(Long.valueOf(id));
|
|
|
fWarehouseInformation += tWarehouse.getfName() + "/";
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNull(fWarehouseInformation) && !fWarehouseInformation.equals("") ){
|
|
|
+ if (StringUtils.isNull(fWarehouseInformation) && !fWarehouseInformation.equals("")) {
|
|
|
fWarehouseInformation = oldName;
|
|
|
} else {
|
|
|
- fWarehouseInformation += oldName;
|
|
|
+ fWarehouseInformation += oldName;
|
|
|
}
|
|
|
return fWarehouseInformation;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 修改仓库库容
|
|
|
+ * 修改仓库库容
|
|
|
+ *
|
|
|
* @param ancestors
|
|
|
* @return
|
|
|
*/
|
|
|
- public int updateWarehousefTotalgross(String ancestors){
|
|
|
+ public int updateWarehousefTotalgross(String ancestors) {
|
|
|
String str[] = ancestors.split(",");
|
|
|
- Long warehouseId =0L;
|
|
|
- for (String id: str){
|
|
|
- if(!(id.equals("0")) && !(id.equals("100"))){
|
|
|
+ Long warehouseId = 0L;
|
|
|
+ for (String id : str) {
|
|
|
+ if (!(id.equals("0")) && !(id.equals("100"))) {
|
|
|
warehouseId = Long.valueOf(id);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(warehouseId!=0){
|
|
|
+ if (warehouseId != 0) {
|
|
|
// 所有库容
|
|
|
BigDecimal fTotalgross = tWarehouseMapper.selectTWarehouseFTotalgross(warehouseId);
|
|
|
TWarehouse tWarehouseNew = new TWarehouse();
|
|
|
tWarehouseNew.setfId(warehouseId);
|
|
|
tWarehouseNew.setfTotalgross(fTotalgross);
|
|
|
- return tWarehouseMapper.updatefTotalgross(tWarehouseNew);
|
|
|
- }else {
|
|
|
+ return tWarehouseMapper.updatefTotalgross(tWarehouseNew);
|
|
|
+ } else {
|
|
|
return 0;
|
|
|
}
|
|
|
}
|