#
luxiaotao1123
2021-05-29 2676a14c9901ac41968a7b1cf064b8b3319d0f69
#
1个文件已修改
25 ■■■■■ 已修改文件
src/main/java/zy/cloud/wms/manager/controller/LocSyncController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/controller/LocSyncController.java
@@ -10,6 +10,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -52,18 +53,26 @@
    @RequestMapping(value = "/locSync/insertWrklocSync")
    @ManagerAuth(memo = "同步上传清单数据插入")
    @Transactional
    public R insertWrklocSync(@RequestBody JSONObject param) {
        Date now = new Date();
        Long userId = getUserId();
        List<WrkLocSync> list = JSONObject.parseArray(param.getJSONArray("list").toJSONString(), WrkLocSync.class);
        // 插入创建人员和创建时间
        if (list.size() > 0) {
            for (WrkLocSync elist : list) {
                elist.setCreateBy(getUserId());
                elist.setCreateTime(new Date());
        for (WrkLocSync wrkLocSync : list) {
            WrkLocSync sync = new WrkLocSync();
            sync.setMatnr(wrkLocSync.getMatnr());
            sync.setQty(wrkLocSync.getQty());
            sync.setState("N");
            sync.setCreateTime(now);
            sync.setCreateBy(userId);
            sync.setUpdateBy(userId);
            sync.setUpdateTime(now);
            if (!wrkLocSyncService.insert(sync)) {
                throw new CoolException("同步失败");
            }
        }
        Integer result = 0;
        result = wrkLocSyncService.insertWrkLocSync(list);
        return R.ok(result);
        return R.ok(list.size());
    }