|
@@ -6,6 +6,7 @@ import com.uas.erp.core.support.SystemSession;
|
|
|
import com.uas.erp.dao.BaseDao;
|
|
|
import com.uas.erp.dao.SqlRowList;
|
|
|
import com.uas.erp.service.scm.InventoryService;
|
|
|
+import org.docx4j.wml.P;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -71,13 +72,21 @@ public class InventoryServiceImpl implements InventoryService {
|
|
|
|
|
|
sql2 = sql2 + " and st_whcode in (" + sql1 + ")";
|
|
|
String dets = baseDao.getJdbcTemplate().queryForObject(sql2, String.class);
|
|
|
-// if (dets != null) {
|
|
|
-// if(inventoryIgnoreEntring){
|
|
|
-// errorLog.append("当前月份同一仓库已存在[在录入]的盘点单!</br>"+dets+"<hr>");
|
|
|
-// }else{
|
|
|
-// BaseUtil.showError("当前月份同一仓库已存在[在录入]的盘点单,不允许进行盘点操作!</br>"+dets+"<hr>");
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (dets != null) {
|
|
|
+ if(inventoryIgnoreEntring){
|
|
|
+ if(inventoryByBatchAndDaoSuan){
|
|
|
+ errorLog.append("盘点期间月份同一仓库已存在[在录入]的盘点单!</br>"+dets+"<hr>");
|
|
|
+ }else{
|
|
|
+ errorLog.append("当前月份同一仓库已存在[在录入]的盘点单!</br>"+dets+"<hr>");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(inventoryByBatchAndDaoSuan){
|
|
|
+ BaseUtil.showError("盘点期间月份同一仓库已存在[在录入]的盘点单,不允许进行盘点操作!</br>"+dets+"<hr>");
|
|
|
+ }else{
|
|
|
+ BaseUtil.showError("当前月份同一仓库已存在[在录入]的盘点单,不允许进行盘点操作!</br>"+dets+"<hr>");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
String sql3 = "select wm_concat(wh_code) from WareHouse where not exists (select 1 from productwh where pw_whcode = wh_code and nvl(pw_onhand,0) > 0 ) and wh_code in ("+sql1+")";
|
|
|
if(inventoryByBatch){
|
|
|
sql3 = "select wm_concat(wh_code) from WareHouse where not exists (select 1 from batch where ba_whcode = wh_code and nvl(ba_remain,0) > 0 ) and wh_code in ("+sql1+")";
|
|
@@ -101,13 +110,13 @@ public class InventoryServiceImpl implements InventoryService {
|
|
|
}else{
|
|
|
sql1 = sql1+ " exists (select 1 from productwh where pw_whcode = wh_code and nvl(pw_onhand,0) > 0 ) ";
|
|
|
}
|
|
|
-// if(inventoryIgnoreEntring){//产生盘点底稿时略过已存在在录入单据的仓库
|
|
|
-// if(inventoryByBatchAndDaoSuan){
|
|
|
-// sql1 = sql1+" and not exists (select 1 from StockTaking where wh_code = st_whcode and nvl(st_statuscode,' ')='ENTERING' and to_char(st_date,'yyyymm')=to_char(to_date('"+pd_enddate+"','yyyymmdd'),'yyyymm'))";
|
|
|
-// }else{
|
|
|
-// sql1 = sql1+" and not exists (select 1 from StockTaking where wh_code = st_whcode and nvl(st_statuscode,' ')='ENTERING' and to_char(st_date,'yyyymm')=to_char(sysdate,'yyyymm'))";
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if(inventoryIgnoreEntring){//产生盘点底稿时略过已存在在录入单据的仓库
|
|
|
+ if(inventoryByBatchAndDaoSuan){
|
|
|
+ sql1 = sql1+" and not exists (select 1 from StockTaking where wh_code = st_whcode and nvl(st_statuscode,' ')='ENTERING' and to_char(st_date,'yyyymm')=to_char(to_date('"+pd_enddate+"','yyyymmdd'),'yyyymm'))";
|
|
|
+ }else{
|
|
|
+ sql1 = sql1+" and not exists (select 1 from StockTaking where wh_code = st_whcode and nvl(st_statuscode,' ')='ENTERING' and to_char(st_date,'yyyymm')=to_char(sysdate,'yyyymm'))";
|
|
|
+ }
|
|
|
+ }
|
|
|
SqlRowList rs = baseDao.queryForRowSet(sql1);
|
|
|
int j = 0;
|
|
|
while (rs.next()) {
|