|
|
@ -32,7 +32,6 @@ import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchDe
|
|
|
|
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
|
|
|
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
|
|
|
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
|
|
|
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
|
|
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
|
|
|
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
|
|
|
import com.hzya.frame.u8c.ax.entity.Ass;
|
|
|
|
|
|
|
|
import com.hzya.frame.web.entity.BaseResult;
|
|
|
|
import com.hzya.frame.web.entity.BaseResult;
|
|
|
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
|
|
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
@ -124,6 +123,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String param = String.valueOf(requestJson.get("param"));
|
|
|
|
String param = String.valueOf(requestJson.get("param"));
|
|
|
|
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneType:stock、tran
|
|
|
|
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneType:stock、tran
|
|
|
|
|
|
|
|
String pushScenarioType = String.valueOf(requestJson.get("pushScenarioType"));
|
|
|
|
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
|
|
|
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
|
|
|
//按单号
|
|
|
|
//按单号
|
|
|
|
if (param != null && !"".equals(param)) {
|
|
|
|
if (param != null && !"".equals(param)) {
|
|
|
@ -133,15 +133,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
//前台页面功能日期推送,或者接口调用也行
|
|
|
|
//前台页面功能日期推送,或者接口调用也行
|
|
|
|
String craeteDateStr = computingTime(param);
|
|
|
|
String craeteDateStr = computingTime(param);
|
|
|
|
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
|
|
|
|
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
|
|
|
|
splitDateAndPush(craeteDateStr, sceneType);
|
|
|
|
splitDateAndPush(craeteDateStr, sceneType, pushScenarioType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
|
|
|
|
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
|
|
|
|
//默认被定时器执行,每天晚上凌晨0点5分
|
|
|
|
//默认被定时器执行,每天晚上凌晨0点5分
|
|
|
|
//暂定先同步TOC销售库存、再推送TOC销售确认收入
|
|
|
|
//暂定先同步TOC销售库存、再推送TOC销售确认收入
|
|
|
|
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
|
|
|
|
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
|
|
|
|
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
|
|
|
|
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time(), "0");
|
|
|
|
startImplementByTradeTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
|
|
|
|
startImplementByTradeTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time(), "0");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -206,7 +206,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author liuyang
|
|
|
|
* @author liuyang
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void startImplementStockByTime(String startTime, String endTime) throws Exception {
|
|
|
|
public void startImplementStockByTime(String startTime, String endTime, String pushScenarioType) throws Exception {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
long startMillis = System.currentTimeMillis();
|
|
|
|
long startMillis = System.currentTimeMillis();
|
|
|
|
String threadNameStrStart = StrUtil.format("开始-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime);
|
|
|
|
String threadNameStrStart = StrUtil.format("开始-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime);
|
|
|
@ -214,25 +214,34 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(startTime, "开始时间不能为空");
|
|
|
|
Assert.notNull(startTime, "开始时间不能为空");
|
|
|
|
Assert.notNull(endTime, "结束时间不能为空");
|
|
|
|
Assert.notNull(endTime, "结束时间不能为空");
|
|
|
|
|
|
|
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空");
|
|
|
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
|
|
|
|
|
|
|
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
|
|
|
|
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
|
|
|
|
|
|
|
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
|
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
|
|
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
|
|
|
queryOfsSoSaleOutVo.setClosedAt_start(startTime);
|
|
|
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
|
|
|
queryOfsSoSaleOutVo.setClosedAt_end(endTime);
|
|
|
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
|
|
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
|
|
|
queryOfsSoSaleOutVo.setClosedAt_start(startTime);
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setClosedAt_end(endTime);
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
|
|
|
// queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
|
|
|
|
// queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
|
|
|
|
//2024年8月22日 14:02:13 已经和O确认,这个字段取消传递!
|
|
|
|
//2024年8月22日 14:02:13 已经和O确认,这个字段取消传递!
|
|
|
|
// queryOfsSoSaleOutVo.setCompanyCode("SHLZ");
|
|
|
|
// queryOfsSoSaleOutVo.setCompanyCode("SHLZ");
|
|
|
|
queryOfsSoSaleOutVo.setStatus(900L);
|
|
|
|
queryOfsSoSaleOutVo.setStatus(900L);
|
|
|
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
|
|
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
|
|
|
queryOfsSoSaleOutVo.setPageSize(50L);
|
|
|
|
queryOfsSoSaleOutVo.setPageSize(50L);
|
|
|
|
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
|
|
|
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
|
|
|
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
|
|
|
|
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
|
|
|
|
// queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001");
|
|
|
|
// queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001");
|
|
|
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
|
|
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
|
|
|
|
|
|
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
|
|
|
|
|
|
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
|
|
|
|
|
|
|
tocofsReturngoodsDetailedEntity.setBusinessDateStart(startTime);
|
|
|
|
|
|
|
|
tocofsReturngoodsDetailedEntity.setBusinessDateEnd(endTime);
|
|
|
|
|
|
|
|
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
|
|
|
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Assert.state(false, "未知的场景类型!");
|
|
|
|
|
|
|
|
}
|
|
|
|
logger.info("TOC退货数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
|
|
|
logger.info("TOC退货数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
|
|
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
|
|
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
|
|
@ -247,11 +256,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
getSetStock(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
getSetStock(returnGoodHeaderDetailsDataDtoArrayList, pushScenarioType);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
long endMillis = System.currentTimeMillis();
|
|
|
|
long endMillis = System.currentTimeMillis();
|
|
|
|
String threadNameStrEnd = StrUtil.format("结束-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
|
|
|
|
String threadNameStrEnd = StrUtil.format("结束-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
|
|
|
|
logger.info(threadNameStrEnd);
|
|
|
|
logger.info(threadNameStrEnd);
|
|
|
@ -302,9 +310,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (sceneType.equals("stock")) {
|
|
|
|
if (sceneType.equals("stock")) {
|
|
|
|
getSetStock(returnGoodHeaderDetailsDataDtoList);
|
|
|
|
getSetStock(returnGoodHeaderDetailsDataDtoList, "2");
|
|
|
|
} else if (sceneType.equals("tran")) {
|
|
|
|
} else if (sceneType.equals("tran")) {
|
|
|
|
getSetTran(returnGoodHeaderDetailsDataDtoList);
|
|
|
|
getSetTran(returnGoodHeaderDetailsDataDtoList, "2");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
@ -320,7 +328,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author liuyang
|
|
|
|
* @author liuyang
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void startImplementByTradeTime(String startTime, String endTime) throws Exception {
|
|
|
|
public void startImplementByTradeTime(String startTime, String endTime, String pushScenarioType) throws Exception {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
long startMillis = System.currentTimeMillis();
|
|
|
|
long startMillis = System.currentTimeMillis();
|
|
|
|
String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime);
|
|
|
|
String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime);
|
|
|
@ -328,24 +336,33 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(startTime, "startTime不能为空");
|
|
|
|
Assert.notNull(startTime, "startTime不能为空");
|
|
|
|
Assert.notNull(endTime, "endTime不能为空");
|
|
|
|
Assert.notNull(endTime, "endTime不能为空");
|
|
|
|
//生成一个时间范围
|
|
|
|
|
|
|
|
// StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
|
|
|
|
|
|
|
|
//2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
|
|
|
|
|
|
|
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
|
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setRefundedAt_start(startTime);
|
|
|
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
|
|
|
queryOfsSoSaleOutVo.setRefundedAt_end(endTime);
|
|
|
|
//生成一个时间范围
|
|
|
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
|
|
|
// StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
|
|
|
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
|
|
|
//2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
|
|
|
|
queryOfsSoSaleOutVo.setPageSize(50L);
|
|
|
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
|
|
|
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
|
|
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
|
|
|
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
|
|
|
|
queryOfsSoSaleOutVo.setRefundedAt_start(startTime);
|
|
|
|
queryOfsSoSaleOutVo.setRefundStatus("900");
|
|
|
|
queryOfsSoSaleOutVo.setRefundedAt_end(endTime);
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setPageSize(50L);
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
|
|
|
|
|
|
|
|
queryOfsSoSaleOutVo.setRefundStatus("900");
|
|
|
|
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
|
|
|
|
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
|
|
|
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
|
|
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
|
|
|
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
|
|
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
|
|
|
|
|
|
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
|
|
|
|
|
|
|
tocofsReturngoodsDetailedEntity.setRefundedAtStart(startTime);
|
|
|
|
|
|
|
|
tocofsReturngoodsDetailedEntity.setRefundedAtEnd(endTime);
|
|
|
|
|
|
|
|
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
|
|
|
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Assert.state(false, "未知的场景类型!");
|
|
|
|
|
|
|
|
} logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
|
|
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
|
|
|
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList.removeIf(new Predicate<StockinOrderSearchResponse.StockinOrder>() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -359,7 +376,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
getSetTran(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
getSetTran(returnGoodHeaderDetailsDataDtoArrayList, pushScenarioType);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
|
logger.info("没有查询到任何数据!不需要同步");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -377,15 +394,17 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author liuyang
|
|
|
|
* @author liuyang
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void getSetStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
|
|
|
|
private void getSetStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList, String pushScenarioType) throws Exception {
|
|
|
|
LOCK1.lock();
|
|
|
|
LOCK1.lock();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//过滤成功的数据
|
|
|
|
//过滤成功的数据
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataStock(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataStock(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
//保存到mysql
|
|
|
|
//保存到mysql
|
|
|
|
batchInsert(stockinOrderList);
|
|
|
|
if (!ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
|
|
|
|
|
|
|
batchInsert(stockinOrderList);
|
|
|
|
|
|
|
|
}
|
|
|
|
//执行推送主逻辑
|
|
|
|
//执行推送主逻辑
|
|
|
|
implementStock(stockinOrderList);
|
|
|
|
implementStock(stockinOrderList, pushScenarioType);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("TOC退货-库存:getSetStock方法抛出异常", e);
|
|
|
|
logger.error("TOC退货-库存:getSetStock方法抛出异常", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -398,15 +417,17 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author liuyang
|
|
|
|
* @author liuyang
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void getSetTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
|
|
|
|
private void getSetTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList, String pushScenarioType) throws Exception {
|
|
|
|
LOCK2.lock();
|
|
|
|
LOCK2.lock();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//过滤成功的数据
|
|
|
|
//过滤成功的数据
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataTran(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataTran(returnGoodHeaderDetailsDataDtoArrayList);
|
|
|
|
//保存到mysql
|
|
|
|
//保存到mysql
|
|
|
|
batchInsert(stockinOrderList);
|
|
|
|
if (!ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
|
|
|
|
|
|
|
batchInsert(stockinOrderList);
|
|
|
|
|
|
|
|
}
|
|
|
|
//执行推送主逻辑
|
|
|
|
//执行推送主逻辑
|
|
|
|
implementTran(stockinOrderList);
|
|
|
|
implementTran(stockinOrderList, pushScenarioType);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("TOC退货-确认收入:getSetTran方法抛出异常", e);
|
|
|
|
logger.error("TOC退货-确认收入:getSetTran方法抛出异常", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -641,9 +662,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
* 库存同步,代码同步逻辑
|
|
|
|
* 库存同步,代码同步逻辑
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
|
|
|
|
|
|
|
* @param pushScenarioType 推送阶段场景
|
|
|
|
* @author liuyang
|
|
|
|
* @author liuyang
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void implementStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) throws Exception {
|
|
|
|
private void implementStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1, String pushScenarioType) throws Exception {
|
|
|
|
|
|
|
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空");
|
|
|
|
if (returnGoodHeaderDetailsDataDtoList1 != null) {
|
|
|
|
if (returnGoodHeaderDetailsDataDtoList1 != null) {
|
|
|
|
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
|
|
|
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -875,31 +898,36 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
queryAdditionUtil.additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity);
|
|
|
|
queryAdditionUtil.additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, "-1", bdTaxitemsEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
|
|
|
//销售订单单据推送到u8c
|
|
|
|
//推送u8c
|
|
|
|
// List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
|
|
|
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
|
|
|
// saleorderRequestDtoList.add(saleorderRequestDto);
|
|
|
|
saleorderRequestDtoList.add(saleorderRequestDto);
|
|
|
|
// Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
|
|
|
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
|
|
|
// stringStringMap.put("saleorder", saleorderRequestDtoList);
|
|
|
|
stringStringMap.put("saleorder", saleorderRequestDtoList);
|
|
|
|
// SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
|
|
|
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
|
|
|
String vreceiptcode = null;
|
|
|
|
String vreceiptcode = null;
|
|
|
|
String pk_corp = null;
|
|
|
|
String pk_corp = null;
|
|
|
|
String csaleid = null;
|
|
|
|
String csaleid = null;
|
|
|
|
// if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
|
|
|
if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
|
|
|
// vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
|
|
|
vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
|
|
|
// pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
|
|
|
pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
|
|
|
// csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
|
|
|
csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// logger.info("TOC销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
|
|
|
logger.info("TOC销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
|
|
|
// TODO 临时方案
|
|
|
|
updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
|
|
|
|
vreceiptcode = "暂存";
|
|
|
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
|
|
|
|
csaleid = "暂存";
|
|
|
|
//选择暂存等待下次发起
|
|
|
|
updateSuccessOrFail1(oldValue, "S", "暂存", vreceiptcode, csaleid);
|
|
|
|
String vreceiptcode = "暂存";
|
|
|
|
//记录成功
|
|
|
|
String csaleid = "暂存";
|
|
|
|
// updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
|
|
|
|
String newstate = "S";
|
|
|
|
|
|
|
|
String newTransmitInfo = "暂存";
|
|
|
|
|
|
|
|
updateSuccessOrFail1(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
|
|
|
|
|
|
|
//记录失败
|
|
|
|
//记录失败
|
|
|
|
|
|
|
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
|
|
|
String message = e.getMessage();
|
|
|
|
String message = e.getMessage();
|
|
|
|
if (message == null) {
|
|
|
|
if (message == null) {
|
|
|
|
message = "未知错误";
|
|
|
|
message = "未知错误";
|
|
|
@ -913,7 +941,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("外层转换逻辑抛出异常", e);
|
|
|
|
logger.error("外层转换逻辑抛出异常", e);
|
|
|
|
// 记录失败
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -924,7 +951,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
|
|
|
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O售后入库单对象
|
|
|
|
* @author liuyang
|
|
|
|
* @author liuyang
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void implementTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) throws Exception {
|
|
|
|
private void implementTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1, String pushScenarioType) throws Exception {
|
|
|
|
|
|
|
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空");
|
|
|
|
if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
|
|
|
|
if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
|
|
|
|
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
|
|
|
logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
|
|
|
|
|
|
|
|
|
|
|
@ -1155,28 +1183,33 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//销售订单单据推送到u8c
|
|
|
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
|
|
|
// List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
|
|
|
//推送U8C
|
|
|
|
// saleorderRequestDtoList.add(saleorderRequestDto);
|
|
|
|
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
|
|
|
// Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
|
|
|
saleorderRequestDtoList.add(saleorderRequestDto);
|
|
|
|
// stringStringMap.put("saleorder", saleorderRequestDtoList);
|
|
|
|
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
|
|
|
// SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
|
|
|
stringStringMap.put("saleorder", saleorderRequestDtoList);
|
|
|
|
|
|
|
|
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
|
|
|
|
String vreceiptcode = null;
|
|
|
|
String vreceiptcode = null;
|
|
|
|
String pk_corp = null;
|
|
|
|
String pk_corp = null;
|
|
|
|
String csaleid = null;
|
|
|
|
String csaleid = null;
|
|
|
|
// if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
|
|
|
if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
|
|
|
|
// vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
|
|
|
vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
|
|
|
|
// pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
|
|
|
pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
|
|
|
// csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
|
|
|
csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// logger.info("TOC销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
|
|
|
logger.info("TOC销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
|
|
|
// TODO 临时方案
|
|
|
|
updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid);
|
|
|
|
vreceiptcode = "暂存";
|
|
|
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
|
|
|
|
csaleid = "暂存";
|
|
|
|
//不推送U8C,单据暂存
|
|
|
|
//记录成功
|
|
|
|
String vreceiptcode = "暂存";
|
|
|
|
updateSuccessOrFail2(oldValue, "S", "暂存", vreceiptcode, csaleid);
|
|
|
|
String csaleid = "暂存";
|
|
|
|
// updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid);
|
|
|
|
String newstate = "S";
|
|
|
|
|
|
|
|
String newTransmitInfo = "暂存";
|
|
|
|
|
|
|
|
updateSuccessOrFail2(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
|
|
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
|
|
|
//记录失败
|
|
|
|
//记录失败
|
|
|
@ -1193,7 +1226,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("外层转换逻辑抛出异常", e);
|
|
|
|
logger.error("外层转换逻辑抛出异常", e);
|
|
|
|
// 记录失败
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2540,7 +2572,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author liuyang
|
|
|
|
* @author liuyang
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void splitDateAndPush(String param, String sceneType) throws Exception {
|
|
|
|
public void splitDateAndPush(String param, String sceneType, String pushScenarioType) throws Exception {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Assert.notNull(param, "param不能为空!");
|
|
|
|
Assert.notNull(param, "param不能为空!");
|
|
|
|
Assert.state(!"".equals(param), "param不能为空!");
|
|
|
|
Assert.state(!"".equals(param), "param不能为空!");
|
|
|
@ -2548,6 +2580,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
Assert.notNull(sceneType, "sceneType不能为空!");
|
|
|
|
Assert.notNull(sceneType, "sceneType不能为空!");
|
|
|
|
Assert.state(!"".equals(sceneType), "sceneType不能为空!");
|
|
|
|
Assert.state(!"".equals(sceneType), "sceneType不能为空!");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(pushScenarioType, "pushScenarioType不能为空!");
|
|
|
|
|
|
|
|
Assert.state(!"".equals(pushScenarioType), "pushScenarioType不能为空!");
|
|
|
|
|
|
|
|
|
|
|
|
if (param.contains("*")) {
|
|
|
|
if (param.contains("*")) {
|
|
|
|
String[] params = param.split("\\*");
|
|
|
|
String[] params = param.split("\\*");
|
|
|
|
if (params.length > 0) {
|
|
|
|
if (params.length > 0) {
|
|
|
@ -2556,9 +2591,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
String[] split = indexStr.split(",");
|
|
|
|
String[] split = indexStr.split(",");
|
|
|
|
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
|
|
|
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
|
|
|
if (sceneType.equals(STOCK)) {
|
|
|
|
if (sceneType.equals(STOCK)) {
|
|
|
|
startImplementStockByTime(split[0], split[1]);
|
|
|
|
startImplementStockByTime(split[0], split[1], pushScenarioType);
|
|
|
|
} else if (sceneType.equals(TRAN)) {
|
|
|
|
} else if (sceneType.equals(TRAN)) {
|
|
|
|
startImplementByTradeTime(split[0], split[1]);
|
|
|
|
startImplementByTradeTime(split[0], split[1], pushScenarioType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2566,9 +2601,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
String[] split = param.split(",");
|
|
|
|
String[] split = param.split(",");
|
|
|
|
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
|
|
|
logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
|
|
|
|
if (sceneType.equals(STOCK)) {
|
|
|
|
if (sceneType.equals(STOCK)) {
|
|
|
|
startImplementStockByTime(split[0], split[1]);
|
|
|
|
startImplementStockByTime(split[0], split[1], pushScenarioType);
|
|
|
|
} else if (sceneType.equals(TRAN)) {
|
|
|
|
} else if (sceneType.equals(TRAN)) {
|
|
|
|
startImplementByTradeTime(split[0], split[1]);
|
|
|
|
startImplementByTradeTime(split[0], split[1], pushScenarioType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -3014,4 +3049,78 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|
|
|
calculationFormulaStr.append(format);
|
|
|
|
calculationFormulaStr.append(format);
|
|
|
|
return amountOfMoney.stripTrailingZeros().toPlainString();
|
|
|
|
return amountOfMoney.stripTrailingZeros().toPlainString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 查询OFS底表的O售后入库单数据
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @author liuyang
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public List<StockinOrderSearchResponse.StockinOrder> queryTocofsReturngoodsDetailed(TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity) throws Exception {
|
|
|
|
|
|
|
|
Assert.notNull(tocofsReturngoodsDetailedEntity, "tocofsReturngoodsDetailedEntity不能为空");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//底表O售后入库单表头对象
|
|
|
|
|
|
|
|
List<TocofsReturngoodsEntity> allTocofsReturngoodsEntityList = new ArrayList<>();
|
|
|
|
|
|
|
|
//底表O售后入库单明细行
|
|
|
|
|
|
|
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList = iTocofsReturngoodsDetailedDao.query(tocofsReturngoodsDetailedEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tocofsReturngoodsDetailedEntityList != null && tocofsReturngoodsDetailedEntityList.size() > 0) {
|
|
|
|
|
|
|
|
List<List<TocofsReturngoodsDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsReturngoodsDetailedEntityList, 1000);
|
|
|
|
|
|
|
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
|
|
|
|
|
|
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = splitListByCount.get(i);
|
|
|
|
|
|
|
|
Set<String> mainTableIdSet = tocofsReturngoodsDetailedEntityList1.stream().map(TocofsReturngoodsDetailedEntity::getMaintableid).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
String mainTableIds = mainTableIdSet.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
//查询对应的O售后入库单表头
|
|
|
|
|
|
|
|
TocofsReturngoodsEntity tocofsReturngoodsEntity = new TocofsReturngoodsEntity();
|
|
|
|
|
|
|
|
tocofsReturngoodsEntity.setIds(mainTableIds);
|
|
|
|
|
|
|
|
List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList = iTocofsReturngoodsDao.query(tocofsReturngoodsEntity);
|
|
|
|
|
|
|
|
allTocofsReturngoodsEntityList.addAll(tocofsReturngoodsEntityList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//通过「O售后入库单表头」匹配「O售后入库单明细」
|
|
|
|
|
|
|
|
if (allTocofsReturngoodsEntityList.size() > 0) {
|
|
|
|
|
|
|
|
for (int i = 0; i < allTocofsReturngoodsEntityList.size(); i++) {
|
|
|
|
|
|
|
|
TocofsReturngoodsEntity tocofsReturngoodsEntity = allTocofsReturngoodsEntityList.get(i);
|
|
|
|
|
|
|
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = new ArrayList<>();
|
|
|
|
|
|
|
|
for (int j = 0; j < tocofsReturngoodsDetailedEntityList.size(); j++) {
|
|
|
|
|
|
|
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity1 = tocofsReturngoodsDetailedEntityList.get(j);
|
|
|
|
|
|
|
|
if (tocofsReturngoodsDetailedEntity.getMaintableid().equals(tocofsReturngoodsEntity.getId())) {
|
|
|
|
|
|
|
|
tocofsReturngoodsDetailedEntityList1.add(tocofsReturngoodsDetailedEntity1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
tocofsReturngoodsEntity.setTocofsReturngoodsDetailedEntityList(tocofsReturngoodsDetailedEntityList1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//转换为OFS售后入库单对象
|
|
|
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
|
|
|
|
|
|
|
if (allTocofsReturngoodsEntityList.size() > 0) {
|
|
|
|
|
|
|
|
for (int i = 0; i < allTocofsReturngoodsEntityList.size(); i++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder stockinOrder = new StockinOrderSearchResponse.StockinOrder();
|
|
|
|
|
|
|
|
returnGoodHeaderDetailsDataDtoArrayList.add(stockinOrder);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理表头
|
|
|
|
|
|
|
|
TocofsReturngoodsEntity tocofsReturngoodsEntity = allTocofsReturngoodsEntityList.get(i);
|
|
|
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinH stockinH = new StockinOrderSearchResponse.StockinOrder.StockinH();
|
|
|
|
|
|
|
|
stockinH.setId(tocofsReturngoodsEntity.getId());
|
|
|
|
|
|
|
|
BeanUtil.copyPropertiesV2(tocofsReturngoodsEntity, stockinH);
|
|
|
|
|
|
|
|
stockinOrder.setHeader(stockinH);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理明细行
|
|
|
|
|
|
|
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = tocofsReturngoodsEntity.getTocofsReturngoodsDetailedEntityList();
|
|
|
|
|
|
|
|
List<StockinOrderSearchResponse.StockinOrder.StockinB> stockinB = new ArrayList<>();
|
|
|
|
|
|
|
|
stockinOrder.setDetails(stockinB);
|
|
|
|
|
|
|
|
for (int j = 0; j < tocofsReturngoodsDetailedEntityList1.size(); j++) {
|
|
|
|
|
|
|
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity1 = tocofsReturngoodsDetailedEntityList1.get(j);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StockinOrderSearchResponse.StockinOrder.StockinB stockinB1 = new StockinOrderSearchResponse.StockinOrder.StockinB();
|
|
|
|
|
|
|
|
BeanUtil.copyPropertiesV2(tocofsReturngoodsDetailedEntity1, stockinB1);
|
|
|
|
|
|
|
|
stockinB1.setId(tocofsReturngoodsDetailedEntity1.getId());
|
|
|
|
|
|
|
|
stockinB.add(stockinB1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return returnGoodHeaderDetailsDataDtoArrayList;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|