|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.glxp.api.service.inout.impl;
|
|
|
|
package com.glxp.api.service.inout.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
@ -7,13 +8,18 @@ import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.dao.inout.IoCodeDao;
|
|
|
|
import com.glxp.api.dao.inout.IoCodeDao;
|
|
|
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeTempDao;
|
|
|
|
|
|
|
|
import com.glxp.api.dao.inout.IoOrderDao;
|
|
|
|
import com.glxp.api.entity.inout.IoCodeEntity;
|
|
|
|
import com.glxp.api.entity.inout.IoCodeEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderEntity;
|
|
|
|
import com.glxp.api.req.inout.FilterCodeRequest;
|
|
|
|
import com.glxp.api.req.inout.FilterCodeRequest;
|
|
|
|
import com.glxp.api.res.inout.IoCodeResponse;
|
|
|
|
import com.glxp.api.res.inout.IoCodeResponse;
|
|
|
|
|
|
|
|
import com.glxp.api.res.inout.IoCodeTempResponse;
|
|
|
|
import com.glxp.api.service.inout.IoCodeService;
|
|
|
|
import com.glxp.api.service.inout.IoCodeService;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
@ -22,6 +28,10 @@ public class IoCodeServiceImpl implements IoCodeService {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IoCodeDao ioCodeDao;
|
|
|
|
private IoCodeDao ioCodeDao;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private IoOrderDao orderDao;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private IoCodeTempDao ioCodeTempDao;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int insert(IoCodeEntity codeEnttity) {
|
|
|
|
public int insert(IoCodeEntity codeEnttity) {
|
|
|
@ -80,5 +90,26 @@ public class IoCodeServiceImpl implements IoCodeService {
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<IoCodeResponse> getCodeListForEdit(FilterCodeRequest filterCodeRequest) {
|
|
|
|
|
|
|
|
List<IoCodeResponse> ioCodeResponses = new ArrayList<>();
|
|
|
|
|
|
|
|
//查询此单的数据
|
|
|
|
|
|
|
|
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", filterCodeRequest.getOrderId()));
|
|
|
|
|
|
|
|
//根据单据状态判断查询正式码表还是临时码表
|
|
|
|
|
|
|
|
if (order.getStatus() > 4) {
|
|
|
|
|
|
|
|
//查询正式码表
|
|
|
|
|
|
|
|
ioCodeResponses = ioCodeDao.filterList(filterCodeRequest);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//查询临时码表
|
|
|
|
|
|
|
|
List<IoCodeTempResponse> list = ioCodeTempDao.selectCodeList(filterCodeRequest);
|
|
|
|
|
|
|
|
for (IoCodeTempResponse ioCodeTempResponse : list) {
|
|
|
|
|
|
|
|
IoCodeResponse ioCodeResponse = new IoCodeResponse();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(ioCodeTempResponse, ioCodeResponse);
|
|
|
|
|
|
|
|
ioCodeResponses.add(ioCodeResponse);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ioCodeResponses;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|