|
|
|
@ -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<PanPackageInfoDTO> order_attributes = factoryOrderDTO.getORDER_ATTRIBUTES(); |
|
|
|
|
QueryWrapper<PanPackageInfo> qw = new QueryWrapper<>(); |
|
|
|
|
qw.eq("order_no",orderNo); |
|
|
|
|
List<PanPackageInfo> list = packageInfoService.list(qw); |
|
|
|
|
for(PanPackageInfo panPackageInfo:list){ |
|
|
|
|
String unitNo = panPackageInfo.getUnitNo(); |
|
|
|
|
for(int i = 0; i<order_attributes.size(); i++){ |
|
|
|
|
String newUnitNo = order_attributes.get(i).getUnitNo(); |
|
|
|
|
if(unitNo.equals(newUnitNo)){ |
|
|
|
|
order_attributes.remove(i); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
factoryOrderDTO.setORDER_ATTRIBUTES(order_attributes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|