skyouc
2 天以前 0800daaeefdc7761ace0ae895f5a0273eb023e46
rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/ScheduleJobs.java
@@ -13,7 +13,10 @@
import com.vincent.rsf.server.system.constant.GlobalConfigCode;
import com.vincent.rsf.server.system.constant.SerialRuleCode;
import com.vincent.rsf.server.system.entity.Config;
import com.vincent.rsf.server.system.entity.FieldsItem;
import com.vincent.rsf.server.system.service.ConfigService;
import com.vincent.rsf.server.system.service.FieldsItemService;
import com.vincent.rsf.server.system.service.impl.FieldsItemServiceImpl;
import com.vincent.rsf.server.system.utils.SerialRuleUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -62,6 +65,8 @@
    private TransferService transferService;
    @Autowired
    private OutStockService outStockService;
    @Autowired
    private FieldsItemService fieldsItemService;
    /**
     * @author Ryan
@@ -83,11 +88,11 @@
        List<WkOrder> orders = asnOrderService.list(new LambdaQueryWrapper<WkOrder>()
                .eq(WkOrder::getType, OrderType.ORDER_IN.type)
                .eq(WkOrder::getExceStatus, AsnExceStatus.ASN_EXCE_STATUS_UN_EXCE.val));
        if (!orders.isEmpty()) {
         if (!orders.isEmpty()) {
            for (WkOrder order : orders) {
                if (order.getWkType().equals(OrderWorkType.ORDER_WORK_TYPE_OTHER_TERANSFER.type)) {
                    WkOrder one = outStockService.getOne(new LambdaQueryWrapper<WkOrder>()
                            .eq(WkOrder::getPoId, order.getPoId())
                            .eq(WkOrder::getPoCode, order.getPoCode())
                            .eq(WkOrder::getWkType, OrderWorkType.ORDER_WORK_TYPE_STOCK_TERANSFER.type));
                    if (Objects.isNull(one)) {
                        throw new CoolException("数据错误");
@@ -185,6 +190,17 @@
                .setFieldsIndex(orderItem.getFieldsIndex())
                .setShipperId(matnr.getShipperId());
        WarehouseAreasItem warehousItem = warehouseAreasItemService.getOne(new LambdaQueryWrapper<WarehouseAreasItem>().eq(StringUtils.isNotBlank(orderItem.getFieldsIndex()), WarehouseAreasItem::getFieldsIndex, orderItem.getFieldsIndex()));
        if (!Objects.isNull(warehousItem)) {
            //希日相同票号,收货区不可新增相同票号数据
            FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>()
                    .eq(FieldsItem::getUuid, orderItem.getFieldsIndex()).last("LIMIT 1"));
            if (!Objects.isNull(fieldsItem)) {
                throw new CoolException("票号:" + fieldsItem.getValue() + "已在收货区,不可推送相当票号数据。请联系管理员!!" );
            }
        }
        LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new LambdaQueryWrapper<WarehouseAreasItem>()
                .eq(WarehouseAreasItem::getMatnrCode, orderItem.getMatnrCode())
                .eq(!Cools.isEmpty(orderItem.getFieldsIndex()), WarehouseAreasItem::getFieldsIndex, orderItem.getFieldsIndex())
@@ -198,7 +214,7 @@
        WarehouseAreasItem serviceOne = warehouseAreasItemService.getOne(queryWrapper);
        if (!Objects.isNull(serviceOne)) {
            item.setId(serviceOne.getId());
            Double anfme = Math.round((item.getAnfme() + serviceOne.getAnfme()) * 10000) / 10000.0;
            Double anfme = Math.round((item.getAnfme() + serviceOne.getAnfme()) * 100) / 100.0;
            item.setAnfme(anfme);
        }
        //未质检