自动化立体仓库 - WMS系统
#
zyx
2024-04-07 7ad79ee463adbdbc51e37c12ae025fb8598ab670
src/main/java/com/zy/asrs/controller/PlaController.java
@@ -18,6 +18,7 @@
import com.zy.common.entity.PlaExcel;
import com.zy.common.web.BaseController;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@@ -30,6 +31,7 @@
import java.util.*;
@RestController
@Slf4j
public class PlaController extends BaseController {
    @Autowired
@@ -101,8 +103,8 @@
    public R delete(@RequestBody List<Pla> plas) {
        System.out.println(plas.toString());
        plas.forEach(pla -> {
            if(!pla.getStatus().equals(GlobleParameter.PLA_STATUS_00) || pla.getStatus().equals(GlobleParameter.PLA_STATUS_0)){
                throw new CoolException("非待入库的数据无法被删除");
            if(!pla.getStatus().equals(GlobleParameter.PLA_STATUS_00) && !pla.getStatus().equals(GlobleParameter.PLA_STATUS_0) && !pla.getStatus().equals(GlobleParameter.PLA_STATUS_1)){
                throw new CoolException("已入库的数据无法被删除");
            }
            Pla plaSave = plaService.selectById(pla.getId());
            pla.setModifyTime(new Date());
@@ -307,8 +309,10 @@
            EasyExcel.read(file.getInputStream(), PlaExcel.class, listener).sheet().doRead();
        }catch (Exception e){
            e.printStackTrace();
            throw new CoolException("导入的数据格式错误,原因:" + e.getMessage() + ",第" + listener.getIndex() + ",数据格式不对");
            int index = listener.getIndex() - 1;
            throw new CoolException("导入的数据格式错误,原因:" + e.getMessage() + ",第" + index + ",数据格式不对");
        }
        log.info("导入修改信息输出:" + listener.getRecordLog());
        return R.ok("成功同步"+listener.getTotal()+"条pla物料数据");
    }