|
@@ -4,6 +4,8 @@ package com.ruoyi.ams.xuankuang.service;
|
|
|
import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
|
|
|
import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
|
|
|
import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
|
|
|
+import com.ruoyi.ams.order.mapper.WmsDocOrderDetailsMapper;
|
|
|
+import com.ruoyi.ams.order.mapper.WmsDocOrderHeaderMapper;
|
|
|
import com.ruoyi.base.constant.Constant;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.hard.xuankang.StirringTankClient;
|
|
@@ -22,45 +24,78 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class StirringTankClientService {
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
|
StirringTankClient stirringTankClient;
|
|
|
@Autowired
|
|
|
BaseLocationInfoSubService baseLocationInfoSubService;
|
|
|
@Autowired
|
|
|
WmsDocOrderSubService wmsDocOrderSubService;
|
|
|
+ @Autowired
|
|
|
+ WmsDocOrderHeaderMapper wmsDocOrderHeaderMapper;
|
|
|
|
|
|
/**
|
|
|
* 对比碳酸钠库存
|
|
|
*
|
|
|
- * @param sku
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean matchInventory_1() {
|
|
|
String sku = "Na2CO3";
|
|
|
BigDecimal b = new BigDecimal(0);
|
|
|
- Number number = stirringTankClient.readTank07();
|
|
|
- List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
- for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
- b = b.add(bigDecimal);
|
|
|
- }
|
|
|
- if (number.intValue() <= b.intValue()) {
|
|
|
- outbound_1();
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
+ //读注入标志位
|
|
|
+ boolean[] booleans = stirringTankClient.readTank13();
|
|
|
+ if (booleans[15] = true) {
|
|
|
+ //读到的碳酸钠所需剂量
|
|
|
+ Number number = stirringTankClient.readTank07();
|
|
|
+ int i = number.intValue();
|
|
|
+ int i1 = ConvertUtils.convertToInt(i);
|
|
|
+ int qty = ConvertUtils.convertToQty(i1);
|
|
|
+ int remainder = ConvertUtils.convertToRemainder(i1);
|
|
|
+ if (remainder >= 25) {
|
|
|
+ qty = qty + 1;
|
|
|
+ }
|
|
|
+ List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
+ for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
+ b = b.add(bigDecimal);
|
|
|
+ }
|
|
|
+ if (qty <= b.intValue()) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
|
|
|
+ wmsDocOrderHeader.setSoReference3("1");
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList1(wmsDocOrderHeader);
|
|
|
+ String orderNo = wmsDocOrderHeaders.get(0).getOrderNo();
|
|
|
+ if (wmsDocOrderHeaders != null && wmsDocOrderHeaders.size() > 0) {
|
|
|
+ boolean[] booleans1 = stirringTankClient.readTank14();
|
|
|
+ if (booleans1[15] = true) {
|
|
|
+ AjaxResult ajaxResult = wmsDocOrderSubService.initOrderDetails(orderNo);
|
|
|
+ if (ajaxResult.isSuccess()) {
|
|
|
+ stirringTankClient.writeTank03();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ stirringTankClient.writeTank02();
|
|
|
+ stirringTankClient.writeTank01f();
|
|
|
+ outbound_1(qty);
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ stirringTankClient.writeTank01();
|
|
|
+ stirringTankClient.writeTank02f();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 触发碳酸钠出库流程
|
|
|
+ * 生成碳酸钠出库单
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- public AjaxResult outbound_1() {
|
|
|
+ public AjaxResult outbound_1(int qty) {
|
|
|
String sku = "Na2CO3";
|
|
|
- Number number = stirringTankClient.readTank07();
|
|
|
- BigDecimal qty = new BigDecimal(number.toString());
|
|
|
- String orderNo = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty);
|
|
|
- wmsDocOrderSubService.initOrderDetails(orderNo);
|
|
|
+ BigDecimal qty1 = new BigDecimal(qty);
|
|
|
+ String orderNo = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty1);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -72,32 +107,61 @@ public class StirringTankClientService {
|
|
|
public boolean matchInventory_2() {
|
|
|
String sku = "C5H10OS2";
|
|
|
BigDecimal b = new BigDecimal(0);
|
|
|
- Number number = stirringTankClient.readTank08();
|
|
|
- List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
- for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
- b = b.add(bigDecimal);
|
|
|
- }
|
|
|
- if (number.intValue() <= b.intValue()) {
|
|
|
- stirringTankClient.writeTank02_1();
|
|
|
- outbound_2();
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- stirringTankClient.writeTank01_1();
|
|
|
- return false;
|
|
|
+ //读注入标志位
|
|
|
+ boolean[] booleans = stirringTankClient.readTank13();
|
|
|
+ if (booleans[14] = true) {
|
|
|
+ //读到的丁黄药所需剂量
|
|
|
+ Number number = stirringTankClient.readTank08();
|
|
|
+ int i = number.intValue();
|
|
|
+ int i1 = ConvertUtils.convertToInt1(i);
|
|
|
+ int qty = ConvertUtils.convertToQty1(i1);
|
|
|
+ int remainder = ConvertUtils.convertToRemainder1(i1);
|
|
|
+ if (remainder >= 20) {
|
|
|
+ qty = qty + 1;
|
|
|
+ }
|
|
|
+ List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
+ for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
+ b = b.add(bigDecimal);
|
|
|
+ }
|
|
|
+ if (qty <= b.intValue()) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
|
|
|
+ wmsDocOrderHeader.setSoReference3("2");
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList1(wmsDocOrderHeader);
|
|
|
+ String orderNo = wmsDocOrderHeaders.get(0).getOrderNo();
|
|
|
+ if (wmsDocOrderHeaders != null && wmsDocOrderHeaders.size() > 0) {
|
|
|
+ boolean[] booleans1 = stirringTankClient.readTank14();
|
|
|
+ if (booleans1[14] = true) {
|
|
|
+ AjaxResult ajaxResult = wmsDocOrderSubService.initOrderDetails(orderNo);
|
|
|
+ if (ajaxResult.isSuccess()) {
|
|
|
+ stirringTankClient.writeTank03_1();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ stirringTankClient.writeTank02_1();
|
|
|
+ stirringTankClient.writeTank01_1f();
|
|
|
+ outbound_2(qty);
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ stirringTankClient.writeTank01_1();
|
|
|
+ stirringTankClient.writeTank02_1f();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 触发丁黄药出库流程
|
|
|
+ * 生成丁黄药出库单
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public AjaxResult outbound_2() {
|
|
|
+ public AjaxResult outbound_2(int qty) {
|
|
|
String sku = "C5H10OS2";
|
|
|
Number number = stirringTankClient.readTank08();
|
|
|
- BigDecimal qty = new BigDecimal(number.toString());
|
|
|
- String order = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty);
|
|
|
- wmsDocOrderSubService.initOrderDetails(order);
|
|
|
+ BigDecimal qty1 = new BigDecimal(qty);
|
|
|
+ String order = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty1);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -109,34 +173,63 @@ public class StirringTankClientService {
|
|
|
public boolean matchInventory_3() {
|
|
|
String sku = "C4H9O2PSSNH4";
|
|
|
BigDecimal b = new BigDecimal(0);
|
|
|
- Number number = stirringTankClient.readTank09();
|
|
|
- List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
- for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
- b = b.add(bigDecimal);
|
|
|
- }
|
|
|
- if (number.intValue() <= b.intValue()) {
|
|
|
- stirringTankClient.writeTank02_2();
|
|
|
- outbound_3();
|
|
|
- return true;
|
|
|
-
|
|
|
- } else {
|
|
|
- stirringTankClient.writeTank01_2();
|
|
|
- return false;
|
|
|
+ //读注入标志位
|
|
|
+ boolean[] booleans = stirringTankClient.readTank13();
|
|
|
+ if (booleans[13] = true) {
|
|
|
+ //读到的丁铵黑药所需剂量
|
|
|
+ Number number = stirringTankClient.readTank09();
|
|
|
+ int i = number.intValue();
|
|
|
+ int i1 = ConvertUtils.convertToInt2(i);
|
|
|
+ int qty = ConvertUtils.convertToQty2(i1);
|
|
|
+ int remainder = ConvertUtils.convertToRemainder2(i1);
|
|
|
+ if (remainder >= 100) {
|
|
|
+ qty = qty + 1;
|
|
|
+ }
|
|
|
+ List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
+ for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
+ b = b.add(bigDecimal);
|
|
|
+ }
|
|
|
+ if (qty <= b.intValue()) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
|
|
|
+ wmsDocOrderHeader.setSoReference3(null);
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList1(wmsDocOrderHeader);
|
|
|
+ if (wmsDocOrderHeaders != null && wmsDocOrderHeaders.size() > 0) {
|
|
|
+ String orderNo = wmsDocOrderHeaders.get(0).getOrderNo();
|
|
|
+ boolean[] booleans1 = stirringTankClient.readTank14();
|
|
|
+ if (booleans1[13] = true) {
|
|
|
+ AjaxResult ajaxResult = wmsDocOrderSubService.initOrderDetails(orderNo);
|
|
|
+ if (ajaxResult.isSuccess()) {
|
|
|
+ stirringTankClient.writeTank03_2();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ stirringTankClient.writeTank02_2();
|
|
|
+ stirringTankClient.writeTank01_2f();
|
|
|
+ outbound_3(qty);
|
|
|
+ return true;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ stirringTankClient.writeTank01_2();
|
|
|
+ stirringTankClient.writeTank02_2f();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 触发丁铵黑药出库流程
|
|
|
+ * 生成丁铵黑药出库单
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public AjaxResult outbound_3(){
|
|
|
+ public AjaxResult outbound_3(int qty) {
|
|
|
String sku = "C4H9O2PSSNH4";
|
|
|
- Number number = stirringTankClient.readTank09();
|
|
|
- BigDecimal qty = new BigDecimal(number.toString());
|
|
|
- String order = wmsDocOrderSubService.generateAnOutboundOrder(sku,qty);
|
|
|
- wmsDocOrderSubService.initOrderDetails(order);
|
|
|
- return AjaxResult.success();
|
|
|
+ Number number = stirringTankClient.readTank09();
|
|
|
+ BigDecimal qty1 = new BigDecimal(qty);
|
|
|
+ String order = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty1);
|
|
|
+ return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -145,35 +238,64 @@ public class StirringTankClientService {
|
|
|
* @return
|
|
|
*/
|
|
|
|
|
|
- public boolean matchInventory_4(){
|
|
|
+ public boolean matchInventory_4() {
|
|
|
String sku = "(NaPO3)6";
|
|
|
BigDecimal b = new BigDecimal(0);
|
|
|
- Number number = stirringTankClient.readTank10();
|
|
|
- List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
- for (BigDecimal bigDecimal: bigDecimals) {
|
|
|
- b = b.add(bigDecimal);
|
|
|
- }
|
|
|
- if(number.intValue() <= b.intValue()){
|
|
|
- stirringTankClient.writeTank02_3();
|
|
|
- outbound_4();
|
|
|
- return true;
|
|
|
- }else {
|
|
|
- stirringTankClient.writeTank01_3();
|
|
|
- return false;
|
|
|
+ //读注入标志位
|
|
|
+ boolean[] booleans = stirringTankClient.readTank13();
|
|
|
+ if (booleans[12] = true) {
|
|
|
+ //读到的六偏磷酸钠所需剂量
|
|
|
+ Number number = stirringTankClient.readTank10();
|
|
|
+ int i = number.intValue();
|
|
|
+ int i1 = ConvertUtils.convertToInt3(i);
|
|
|
+ int qty = ConvertUtils.convertToQty3(i1);
|
|
|
+ int remainder = ConvertUtils.convertToRemainder3(i1);
|
|
|
+ if (remainder >= 35) {
|
|
|
+ qty = qty + 1;
|
|
|
+ }
|
|
|
+ List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
+ for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
+ b = b.add(bigDecimal);
|
|
|
+ }
|
|
|
+ if (qty <= b.intValue()) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
|
|
|
+ wmsDocOrderHeader.setSoReference3("3");
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList1(wmsDocOrderHeader);
|
|
|
+ if (wmsDocOrderHeaders != null && wmsDocOrderHeaders.size() > 0) {
|
|
|
+ String orderNo = wmsDocOrderHeaders.get(0).getOrderNo();
|
|
|
+ boolean[] booleans1 = stirringTankClient.readTank14();
|
|
|
+ if (booleans1[12] = true) {
|
|
|
+ AjaxResult ajaxResult = wmsDocOrderSubService.initOrderDetails(orderNo);
|
|
|
+ if (ajaxResult.isSuccess()) {
|
|
|
+ stirringTankClient.writeTank03_3();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ stirringTankClient.writeTank02_3();
|
|
|
+ stirringTankClient.writeTank01_3f();
|
|
|
+ outbound_4(qty);
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ stirringTankClient.writeTank01_3();
|
|
|
+ stirringTankClient.writeTank02_3f();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 触发六偏磷酸钠出库流程
|
|
|
+ * 生成六偏磷酸钠出库单
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public AjaxResult outbound_4(){
|
|
|
+ public AjaxResult outbound_4(int qty) {
|
|
|
String sku = "(NaPO3)6";
|
|
|
Number number = stirringTankClient.readTank10();
|
|
|
- BigDecimal qty = new BigDecimal(number.toString());
|
|
|
- String order = wmsDocOrderSubService.generateAnOutboundOrder(sku,qty);
|
|
|
- wmsDocOrderSubService.initOrderDetails(order);
|
|
|
+ BigDecimal qty1 = new BigDecimal(qty);
|
|
|
+ String order = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty1);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -182,35 +304,64 @@ public class StirringTankClientService {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public boolean matchInventory_5(){
|
|
|
+ public boolean matchInventory_5() {
|
|
|
String sku = "(NH4)2SO4";
|
|
|
BigDecimal b = new BigDecimal(0);
|
|
|
- Number number = stirringTankClient.readTank11();
|
|
|
- List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
- for (BigDecimal bigDecimal: bigDecimals) {
|
|
|
- b = b.add(bigDecimal);
|
|
|
- }
|
|
|
- if(number.intValue() <= b.intValue()){
|
|
|
- stirringTankClient.writeTank02_4();
|
|
|
- outbound_5();
|
|
|
- return true;
|
|
|
- }else{
|
|
|
- stirringTankClient.writeTank01_4();
|
|
|
- return false;
|
|
|
+ //读注入标志位
|
|
|
+ boolean[] booleans = stirringTankClient.readTank13();
|
|
|
+ if (booleans[11] = true) {
|
|
|
+ //读到的硫酸铵所需剂量
|
|
|
+ Number number = stirringTankClient.readTank11();
|
|
|
+ int i = number.intValue();
|
|
|
+ int i1 = ConvertUtils.convertToInt4(i);
|
|
|
+ int qty = ConvertUtils.convertToQty4(i1);
|
|
|
+ int remainder = ConvertUtils.convertToRemainder4(i1);
|
|
|
+ if (remainder >= 25) {
|
|
|
+ qty = qty + 1;
|
|
|
+ }
|
|
|
+ List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
+ for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
+ b = b.add(bigDecimal);
|
|
|
+ }
|
|
|
+ if (qty <= b.intValue()) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
|
|
|
+ wmsDocOrderHeader.setSoReference3("4");
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList1(wmsDocOrderHeader);
|
|
|
+ if (wmsDocOrderHeaders != null && wmsDocOrderHeaders.size() > 0) {
|
|
|
+ String orderNo = wmsDocOrderHeaders.get(0).getOrderNo();
|
|
|
+ boolean[] booleans1 = stirringTankClient.readTank14();
|
|
|
+ if (booleans1[11] = true) {
|
|
|
+ AjaxResult ajaxResult = wmsDocOrderSubService.initOrderDetails(orderNo);
|
|
|
+ if (ajaxResult.isSuccess()) {
|
|
|
+ stirringTankClient.writeTank03_4();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ stirringTankClient.writeTank02_4();
|
|
|
+ stirringTankClient.writeTank01_4f();
|
|
|
+ outbound_5(qty);
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ stirringTankClient.writeTank01_4();
|
|
|
+ stirringTankClient.writeTank02_4f();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 触发硫酸铵出库流程
|
|
|
+ * 生成硫酸铵出库单
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public AjaxResult outbound_5(){
|
|
|
+ public AjaxResult outbound_5(int qty) {
|
|
|
String sku = "(NH4)2SO4";
|
|
|
Number number = stirringTankClient.readTank11();
|
|
|
- BigDecimal qty = new BigDecimal(number.toString());
|
|
|
- String order = wmsDocOrderSubService.generateAnOutboundOrder(sku,qty);
|
|
|
- wmsDocOrderSubService.initOrderDetails(order);
|
|
|
+ BigDecimal qty1 = new BigDecimal(qty);
|
|
|
+ String order = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty1);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -219,36 +370,118 @@ public class StirringTankClientService {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public boolean matchInventory_6() {
|
|
|
+ public boolean
|
|
|
+ matchInventory_6() {
|
|
|
String sku = "CH3CH2OCS2Na";
|
|
|
BigDecimal b = new BigDecimal(0);
|
|
|
- Number number = stirringTankClient.readTank12();
|
|
|
- List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
- for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
- b = b.add(bigDecimal);
|
|
|
- }
|
|
|
- if (number.intValue() <= b.intValue()) {
|
|
|
- stirringTankClient.writeTank02_5();
|
|
|
- outbound_6();
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- stirringTankClient.writeTank01_5();
|
|
|
- return false;
|
|
|
+ //读注入标志位
|
|
|
+ boolean[] booleans = stirringTankClient.readTank13();
|
|
|
+ if (booleans[10] = true) {
|
|
|
+ //读到的乙黄药所需剂量
|
|
|
+ Number number = stirringTankClient.readTank12();
|
|
|
+ int i = number.intValue();
|
|
|
+ int i1 = ConvertUtils.convertToInt5(i);
|
|
|
+ int qty = ConvertUtils.convertToQty5(i1);
|
|
|
+ int remainder = ConvertUtils.convertToRemainder5(i1);
|
|
|
+ if (remainder >= 20) {
|
|
|
+ qty = qty + 1;
|
|
|
+ }
|
|
|
+ List<BigDecimal> bigDecimals = baseLocationInfoSubService.checkInventory(sku);
|
|
|
+ for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
+ b = b.add(bigDecimal);
|
|
|
+ }
|
|
|
+ if (qty <= b.intValue()) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
|
|
|
+ wmsDocOrderHeader.setSoReference3("5");
|
|
|
+ List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList1(wmsDocOrderHeader);
|
|
|
+ if (wmsDocOrderHeaders != null && wmsDocOrderHeaders.size() > 0) {
|
|
|
+ String orderNo = wmsDocOrderHeaders.get(0).getOrderNo();
|
|
|
+ boolean[] booleans1 = stirringTankClient.readTank14();
|
|
|
+ if (booleans1[10] = true) {
|
|
|
+ AjaxResult ajaxResult = wmsDocOrderSubService.initOrderDetails(orderNo);
|
|
|
+ if (ajaxResult.isSuccess()) {
|
|
|
+ stirringTankClient.writeTank03_5();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ stirringTankClient.writeTank02_5();
|
|
|
+ stirringTankClient.writeTank01_5f();
|
|
|
+ outbound_6(qty);
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ stirringTankClient.writeTank01_5();
|
|
|
+ stirringTankClient.writeTank02_5f();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 触发乙黄药出库流程
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- public AjaxResult outbound_6(){
|
|
|
- String sku = "CH3CH2OCS2Na";
|
|
|
- Number number = stirringTankClient.readTank12();
|
|
|
- BigDecimal qty = new BigDecimal(number.toString());
|
|
|
- String order = wmsDocOrderSubService.generateAnOutboundOrder(sku,qty);
|
|
|
- wmsDocOrderSubService.initOrderDetails(order);
|
|
|
- return AjaxResult.success();
|
|
|
+ /**
|
|
|
+ * 生成乙黄药出库单
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AjaxResult outbound_6(int qty) {
|
|
|
+ String sku = "CH3CH2OCS2Na";
|
|
|
+ Number number = stirringTankClient.readTank12();
|
|
|
+ BigDecimal qty1 = new BigDecimal(qty);
|
|
|
+ String order = wmsDocOrderSubService.generateAnOutboundOrder(sku, qty1);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 清除所有写的数据
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AjaxResult clear() {
|
|
|
+ boolean[] booleans = stirringTankClient.readTank16();
|
|
|
+ if (booleans[15] = true) {
|
|
|
+ stirringTankClient.writeTank01f();
|
|
|
+ stirringTankClient.writeTank02f();
|
|
|
+ stirringTankClient.writeTank03f();
|
|
|
+ stirringTankClient.writeTank04f();
|
|
|
+ stirringTankClient.writeTank05f();
|
|
|
+ }
|
|
|
+ if (booleans[14] = true) {
|
|
|
+ stirringTankClient.writeTank01_1f();
|
|
|
+ stirringTankClient.writeTank02_1f();
|
|
|
+ stirringTankClient.writeTank03_1f();
|
|
|
+ stirringTankClient.writeTank04_1f();
|
|
|
+ stirringTankClient.writeTank05_1f();
|
|
|
+ }
|
|
|
+ if (booleans[13] = true) {
|
|
|
+ stirringTankClient.writeTank01_2f();
|
|
|
+ stirringTankClient.writeTank02_2f();
|
|
|
+ stirringTankClient.writeTank03_2f();
|
|
|
+ stirringTankClient.writeTank04_2f();
|
|
|
+ stirringTankClient.writeTank05_2f();
|
|
|
}
|
|
|
+ if (booleans[12] = true) {
|
|
|
+ stirringTankClient.writeTank01_3f();
|
|
|
+ stirringTankClient.writeTank02_3f();
|
|
|
+ stirringTankClient.writeTank03_3f();
|
|
|
+ stirringTankClient.writeTank04_3f();
|
|
|
+ stirringTankClient.writeTank05_3f();
|
|
|
+ }
|
|
|
+ if (booleans[11] = true) {
|
|
|
+ stirringTankClient.writeTank01_4f();
|
|
|
+ stirringTankClient.writeTank02_4f();
|
|
|
+ stirringTankClient.writeTank03_4f();
|
|
|
+ stirringTankClient.writeTank04_4f();
|
|
|
+ stirringTankClient.writeTank05_4f();
|
|
|
+ }
|
|
|
+ if (booleans[10] = true) {
|
|
|
+ stirringTankClient.writeTank01_5f();
|
|
|
+ stirringTankClient.writeTank02_5f();
|
|
|
+ stirringTankClient.writeTank03_5f();
|
|
|
+ stirringTankClient.writeTank04_5f();
|
|
|
+ stirringTankClient.writeTank05_5f();
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
}
|
|
|
+}
|
|
|
|