|
|
|
@ -6,15 +6,9 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.logpm.factory.oupai.entity.FactoryOrderEntity; |
|
|
|
|
import com.logpm.factory.oupai.entity.FactoryPackageEntity; |
|
|
|
|
import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity; |
|
|
|
|
import com.logpm.factory.oupai.entity.ReceivingOrderEntity; |
|
|
|
|
import com.logpm.factory.oupai.entity.*; |
|
|
|
|
import com.logpm.factory.oupai.mapper.ReceivingOrderMapper; |
|
|
|
|
import com.logpm.factory.oupai.service.IFactoryOrderService; |
|
|
|
|
import com.logpm.factory.oupai.service.IFactoryPackageService; |
|
|
|
|
import com.logpm.factory.oupai.service.IOpOrderStatusLogService; |
|
|
|
|
import com.logpm.factory.oupai.service.IOuPaiFactoryService; |
|
|
|
|
import com.logpm.factory.oupai.service.*; |
|
|
|
|
import com.logpm.factory.props.OuPaiProperties; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
@ -43,6 +37,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
@Autowired |
|
|
|
|
private IOpOrderStatusLogService opOrderStatusLogService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IFactoryPackageDetailService factoryPackageDetailService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String saveOuPaiFactoryOrderDTOByCarCarNumber(String carNumber) { |
|
|
|
|
|
|
|
|
@ -204,7 +201,11 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
factoryOrderEntity.setReservationStatus(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
factoryOrderEntity.setStoreName("");//TODO 没有找到门店字段
|
|
|
|
|
JSONObject store = orderEntity.getJSONObject("Store"); |
|
|
|
|
if(!Objects.isNull(store)){ |
|
|
|
|
factoryOrderEntity.setStoreCode(store.getString("Code")); |
|
|
|
|
factoryOrderEntity.setStoreName(store.getString("Name")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
factoryOrderEntity.setMatingCode(orderEntity.getString("MatingCode")); |
|
|
|
|
Boolean isMating = orderEntity.getBoolean("IsMating"); |
|
|
|
@ -325,11 +326,30 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setFreeze(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存包件信息
|
|
|
|
|
factoryPackageEntity.setReceiptStatus(0); |
|
|
|
|
factoryPackageEntity.setPushStatus(0); |
|
|
|
|
factoryPackageEntity.setTurnStatus(0); |
|
|
|
|
factoryPackageService.save(factoryPackageEntity); |
|
|
|
|
boolean save = factoryPackageService.save(factoryPackageEntity); |
|
|
|
|
if(save){ |
|
|
|
|
Long packageId = factoryPackageEntity.getId(); |
|
|
|
|
//保存物料信息
|
|
|
|
|
JSONArray packageDetails = packageEntity.getJSONArray("PackageDetails"); |
|
|
|
|
if(!Objects.isNull(packageDetails)){ |
|
|
|
|
for (int k = 0; k < packageDetails.size(); k++) { |
|
|
|
|
JSONObject packageDetailsJSONObject = packageDetails.getJSONObject(k); |
|
|
|
|
FactoryPackageDetailEntity factoryPackageDetailEntity = new FactoryPackageDetailEntity(); |
|
|
|
|
factoryPackageDetailEntity.setPackageId(packageId); |
|
|
|
|
factoryPackageDetailEntity.setCode(packageDetailsJSONObject.getString("Code")); |
|
|
|
|
factoryPackageDetailEntity.setName(packageDetailsJSONObject.getString("Name")); |
|
|
|
|
factoryPackageDetailEntity.setType(packageDetailsJSONObject.getString("Type")); |
|
|
|
|
factoryPackageDetailEntity.setUnit(packageDetailsJSONObject.getString("Unit")); |
|
|
|
|
factoryPackageDetailEntity.setOrgCode(packageDetailsJSONObject.getString("OrgCode")); |
|
|
|
|
factoryPackageDetailService.save(factoryPackageDetailEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.warn("############handleData: 包件码已存在 packageCode={}", packageCode); |
|
|
|
|
throw new CustomerException(403, "包件码已存在"); |
|
|
|
|