|
@@ -12,6 +12,7 @@ import com.ruoyi.ccb.domain.basic.SyncedOrg;
|
|
|
import com.ruoyi.ccb.service.CcbHttpService;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.reportManagement.domain.TWhgenleg;
|
|
|
import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
|
|
|
import com.ruoyi.warehouseBusiness.service.IWarehouseBillsCcbService;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -211,7 +213,7 @@ public class CcbHttpServiceImpl implements CcbHttpService {
|
|
|
.map(CargoDetail::getTakeVoucher)
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- AjaxResult result = ccbService.unlockStock(billNoList, true);
|
|
|
+ AjaxResult result = ccbService.lockStock(pledge.getUserName(), billNoList, true);
|
|
|
|
|
|
PledgeR pledgeR = new PledgeR();
|
|
|
pledgeR.setUserName(pledge.getUserName());
|
|
@@ -504,24 +506,97 @@ public class CcbHttpServiceImpl implements CcbHttpService {
|
|
|
|
|
|
/**
|
|
|
* 跌价补货
|
|
|
- * @param replenishment 报文
|
|
|
- * @return 结果
|
|
|
+ *
|
|
|
+ * @param replenishment 报文
|
|
|
+ * @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
public ReplenishmentR cargosRF(Replenishment replenishment) {
|
|
|
|
|
|
- return null;
|
|
|
- }
|
|
|
+ //获取补货清单
|
|
|
+ List<CargoDetail> cargos = replenishment.getCargos();
|
|
|
+
|
|
|
+ //补货之后清单
|
|
|
+ List<CargoDetail> newCargos = new ArrayList<>();
|
|
|
+
|
|
|
+ //补货返回
|
|
|
+ ReplenishmentR replenishmentR = new ReplenishmentR();
|
|
|
+
|
|
|
+ replenishmentR.setUserName(replenishment.getUserName());
|
|
|
+ replenishmentR.setUscc(replenishment.getUscc());
|
|
|
+ replenishmentR.setNewUserName(replenishment.getNewUserName());
|
|
|
+ replenishmentR.setNewUserNameUSCC(replenishment.getNewUserNameUSCC());
|
|
|
+ replenishmentR.setReqUser(replenishment.getReqUser());
|
|
|
+
|
|
|
+ //判断补货清单是否为空
|
|
|
+ if (ObjectUtil.isNotNull(cargos)) {
|
|
|
+ int count = 0;
|
|
|
+ //遍历补货清单,开始补货
|
|
|
+ for (CargoDetail cargoDetail : cargos) {
|
|
|
+ TWhgenleg stock = new TWhgenleg();
|
|
|
+ stock.setLockStatus(1);
|
|
|
+ stock.setfOriginalbillno(cargoDetail.getTakeVoucher());
|
|
|
+ stock.setUnlockTime(new Date());
|
|
|
+ stock.setBelongTo(replenishment.getNewUserName());
|
|
|
+ stock.setWrNumber(cargoDetail.getTakeVoucher());
|
|
|
+ int re = ccbService.cargosRF(stock, replenishment.getUserName());
|
|
|
+ if (re == 2) {
|
|
|
+ count++;
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 移库请求
|
|
|
- * @param moveCargo 报文
|
|
|
- * @return 结果
|
|
|
- */
|
|
|
- @Override
|
|
|
- public MoveCargoR moveCargoReq(MoveCargo moveCargo) {
|
|
|
+ }
|
|
|
+ //判断是否全部补货成功
|
|
|
+ if (count == cargos.size()) {
|
|
|
+ replenishmentR.setResult("Y");
|
|
|
+ //通过补货清单中保管凭证号查询补货之后清单数据
|
|
|
+ // 库存帐查询
|
|
|
+ List<Map<String, Object>> stockList = ccbService.getStockList(cargos.get(0).getTakeVoucher(), replenishment.getUserName());
|
|
|
+ stockList.forEach(map -> {
|
|
|
+ String temp = JSON.toJSONString(map);
|
|
|
+
|
|
|
+ //获取清单数据
|
|
|
+ CargoDetail detail = JSON.parseObject(temp, CargoDetail.class);
|
|
|
+ detail.setNumberUnit("件");
|
|
|
+ detail.setWeightUnit("千克");
|
|
|
+ detail.setCargoBelong(replenishment.getUserName());
|
|
|
+ detail.setInStorageNumber(detail.getTakeVoucher());
|
|
|
+ detail.setRemainNumber(detail.getNumberLeft());
|
|
|
+ detail.setRemainWeight(detail.getWeightLeft());
|
|
|
+ detail.setElectronicTags(ccbService.getLabel(detail.getTakeVoucher()));
|
|
|
+
|
|
|
+ JSONObject object = JSON.parseObject(temp);
|
|
|
+ //判断状态锁
|
|
|
+ if (!"0".equals(object.getString("lockStatus"))) {
|
|
|
+ CargoLockInfo lockInfo = new CargoLockInfo();
|
|
|
+ lockInfo.setCargoNo(detail.getCargoNo());
|
|
|
+ lockInfo.setBlNumber(detail.getBlNumber());
|
|
|
+ lockInfo.setCargoBelong(detail.getCargoBelong());
|
|
|
+ lockInfo.setTakeVoucher(detail.getTakeVoucher());
|
|
|
+ lockInfo.setNumber(detail.getNumberLeft());
|
|
|
+ lockInfo.setNumberUnit(detail.getNumberUnit());
|
|
|
+ lockInfo.setWeight(detail.getWeightLeft());
|
|
|
+ lockInfo.setWeightUnit(detail.getWeightUnit());
|
|
|
+ lockInfo.setSpeci(detail.getSpeci());
|
|
|
+ lockInfo.setReasonCode("PLGL");
|
|
|
+ lockInfo.setLockTime(object.getDate("lockTime"));
|
|
|
+ lockInfo.setWrNumber(detail.getWrNumber());
|
|
|
+ lockInfo.setElectronicTags(detail.getElectronicTags());
|
|
|
+ detail.setLockInfo(lockInfo);
|
|
|
+ }
|
|
|
+ newCargos.add(detail);
|
|
|
+ });
|
|
|
+ replenishmentR.setCargos(newCargos);
|
|
|
+ } else {//补货未成功返回
|
|
|
+ replenishmentR.setResult("N");
|
|
|
+ replenishmentR.setReason("跌价补货部分成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {//补货货物清单为空返回
|
|
|
+ replenishmentR.setResult("N");
|
|
|
+ replenishmentR.setReason("跌价补货的货物清单为空");
|
|
|
+ }
|
|
|
|
|
|
- return null;
|
|
|
+ return replenishmentR;
|
|
|
}
|
|
|
|
|
|
/**
|