自动化立体仓库 - WMS系统
#
Junjie
19 小时以前 6f01b51fc0770fda7787076caf0314be7a7f6656
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -20,7 +20,10 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@@ -106,7 +109,8 @@
                9527L,    // 修改人员
                now,    // 修改时间
                null,   // 备注
                1
                1,
                null
        );
        if (!orderService.insert(order)) {
@@ -278,7 +282,8 @@
                9527L,    // 修改人员
                now,    // 修改时间
                null,    // 备注
                2
                2,
                param.getKpCstmrName()
        );
        if (!orderService.insert(order)) {
            throw new CoolException("生成单据主档失败,请联系管理员");
@@ -615,4 +620,24 @@
    }
    @Override
    public int syncAnfmeToWeight() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date(2025, Calendar.JULY, 24);
        Date date2 = new Date(2025, Calendar.JULY, 24, 23, 59, 59);
        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                .ge("appe_time", format.format(date))
                .le("appe_time", format.format(date2))
        );
        int i = 0;
        for (LocDetl locDetl : locDetls) {
            // 修改库存
            Double anfme = MatUtils.calcAnfmeFromWeight(locDetl.getMatnr(), locDetl.getAnfme());
            locDetlService.updateAnfme(anfme, locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(),
                    locDetl.getStandby1(), locDetl.getStandby2(), locDetl.getStandby3(), locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3());
            i++;
        }
        return i;
    }
}