diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java index 88db3c06a..6f6781d30 100644 --- a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanPackageInfo.java @@ -66,4 +66,7 @@ public class PanPackageInfo extends BaseEntity { @ApiModelProperty(value = "直发标识") private String directSignage; + @ApiModelProperty(value = "是否补发") + private Integer reissueStatus; + } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java index 25e7fd80a..66a19ef66 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java @@ -22,6 +22,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.factory.comfac.service.IAsyncDataService; import com.logpm.factory.comfac.service.IOrderStatusLogService; import com.logpm.factory.pan.dto.PanFactoryOrderDTO; +import com.logpm.factory.pan.dto.PanPackageInfoDTO; import com.logpm.factory.pan.service.IPanFactoryDataService; import com.logpm.factory.pan.service.IPanFactoryOrderService; import com.logpm.factory.pan.service.IPanPackageInfoService; @@ -29,6 +30,7 @@ import com.logpm.factory.pan.service.IPanPackageListService; import com.logpm.factory.snm.bean.Resp; import com.logpm.factory.snm.entity.OrderStatusLog; import com.logpm.factory.snm.entity.PanFactoryOrder; +import com.logpm.factory.snm.entity.PanPackageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -39,6 +41,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.List; import java.util.Objects; /** @@ -116,8 +119,24 @@ public class PanFactoryDataController extends BladeController { queryWrapper.eq("order_no",orderNo); PanFactoryOrder one = factoryOrderService.getOne(queryWrapper); if(!Objects.isNull(one)){ - log.warn("############data: 订单数据已存在 orderNo={}",orderNo); - return Resp.fail(400,"订单数据已存在"); +// log.warn("############data: 订单数据已存在 orderNo={}",orderNo); +// return Resp.fail(400,"订单数据已存在"); + //如果订单已存在就去验证订单下面的包件信息 + List order_attributes = factoryOrderDTO.getORDER_ATTRIBUTES(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("order_no",orderNo); + List list = packageInfoService.list(qw); + for(PanPackageInfo panPackageInfo:list){ + String unitNo = panPackageInfo.getUnitNo(); + for(int i = 0; i qw = new QueryWrapper<>(); + qw.eq("order_no",factoryOrderDTO.getOrderNo()); + //先查询订单是否存在 + PanFactoryOrder factoryOrder = factoryOrderService.getOne(qw); + boolean flag = false; + if(Objects.isNull(factoryOrder)){ + factoryOrder = new PanFactoryOrder(); + BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); + //保存订单数据 + factoryOrderService.save(factoryOrder); + }else{ + flag = true; + } + +// PanFactoryOrder factoryOrder = new PanFactoryOrder(); +// BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); +// //保存订单数据 +// factoryOrderService.save(factoryOrder); List packageInfos = factoryOrderDTO.getORDER_ATTRIBUTES(); List panPackageInfos = new ArrayList<>(); @@ -383,7 +398,13 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { PanPackageInfo packageInfo = new PanPackageInfo(); BeanUtil.copyProperties(dto,packageInfo); packageInfo.setOrderId(factoryOrder.getId()); + if(flag){ + packageInfo.setReissueStatus(1); + }else{ + packageInfo.setReissueStatus(0); + } panPackageInfos.add(packageInfo); + //保存包件信息数据 //因为需要先保存包件明细需要包件的id // packageInfoService.save(packageInfo);