|
|
|
@ -4,30 +4,25 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
|
import com.glxp.api.constant.WorkOperType;
|
|
|
|
|
import com.glxp.api.dao.basic.BasicSkPrescribeItemCodeMapper;
|
|
|
|
|
import com.glxp.api.dao.collect.IoCollectOrderCodeAutoMapper;
|
|
|
|
|
import com.glxp.api.dao.collect.IoCollectOrderCodeManMapper;
|
|
|
|
|
import com.glxp.api.entity.auth.SysWorkplace;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicCollectBustypeEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicSkPrescribeItemCode;
|
|
|
|
|
import com.glxp.api.entity.basic.SysWorkplaceDocumentEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiEntity;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectOrder;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectOrderBiz;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectOrderCodeAuto;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectOrderCodeMan;
|
|
|
|
|
import com.glxp.api.entity.inout.IoSplitCodeEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrSystemEntity;
|
|
|
|
|
import com.glxp.api.exception.JsonException;
|
|
|
|
|
import com.glxp.api.req.collect.CollectOrderCodeAutoRequest;
|
|
|
|
|
import com.glxp.api.req.collect.CollectOrderCodeManRequest;
|
|
|
|
|
import com.glxp.api.req.inout.AddTagCodeReqeust;
|
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
|
import com.glxp.api.res.collect.CollectOrderCodeAutoResponse;
|
|
|
|
|
import com.glxp.api.res.collect.CollectOrderCodeManResponse;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.service.auth.SysWorkplaceService;
|
|
|
|
@ -44,6 +39,7 @@ import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
|
import com.glxp.api.util.udi.UdiCalCountUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -51,11 +47,6 @@ import java.util.Collections;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectOrderCodeMan;
|
|
|
|
|
import com.glxp.api.dao.collect.IoCollectOrderCodeManMapper;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
public class IoCollectOrderCodeManService extends ServiceImpl<IoCollectOrderCodeManMapper, IoCollectOrderCodeMan> {
|
|
|
|
|
@Resource
|
|
|
|
@ -214,7 +205,7 @@ public class IoCollectOrderCodeManService extends ServiceImpl<IoCollectOrderCode
|
|
|
|
|
int needCount = IntUtil.value(collectOrderBiz.getCount()) - IntUtil.value(collectOrderBiz.getScanActCount());
|
|
|
|
|
if (needCount > 0) {
|
|
|
|
|
if (vailInSplit(collectOrderBiz, collectOrder.getWorkPlaceCode(), needCount)) {
|
|
|
|
|
throw new JsonException(502, "当前拆零数量还有剩余,是否继续扫码?");
|
|
|
|
|
throw new JsonException(502, collectOrderBiz.getCpmctymc() + "拆零数量还有剩余,是否继续添加?");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
throw new JsonException(500, "扫码数量超出!");
|
|
|
|
@ -225,7 +216,7 @@ public class IoCollectOrderCodeManService extends ServiceImpl<IoCollectOrderCode
|
|
|
|
|
case 3: //提醒是否插入
|
|
|
|
|
if (!IntUtil.value(addTagCodeReqeust.getInsert())) {
|
|
|
|
|
if (collectOrderBiz == null)
|
|
|
|
|
throw new JsonException(502, "非此单据追溯码!");
|
|
|
|
|
throw new JsonException(502, "非此单据追溯码,是否继续添加!");
|
|
|
|
|
int count1 = IntUtil.value(collectOrderBiz.getScanCount()) + 1;
|
|
|
|
|
int actCount1 = 0;
|
|
|
|
|
if (IntUtil.value(collectOrder.getOrderCirType()) == 1) {
|
|
|
|
@ -237,10 +228,10 @@ public class IoCollectOrderCodeManService extends ServiceImpl<IoCollectOrderCode
|
|
|
|
|
int needCount = IntUtil.value(collectOrderBiz.getCount()) - IntUtil.value(collectOrderBiz.getScanActCount());
|
|
|
|
|
if (needCount > 0) {
|
|
|
|
|
if (vailInSplit(collectOrderBiz, collectOrder.getWorkPlaceCode(), needCount)) {
|
|
|
|
|
throw new JsonException(502, "当前拆零数量还有剩余,是否继续扫码?");
|
|
|
|
|
throw new JsonException(502, collectOrderBiz.getCpmctymc() + "拆零数量还有剩余,是否继续扫码?");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
throw new JsonException(502, "扫码数量超出!");
|
|
|
|
|
throw new JsonException(502, "扫码数量超出,是否继续添加!");
|
|
|
|
|
}
|
|
|
|
|
collectOrderBiz.setScanCount(count1);
|
|
|
|
|
collectOrderBiz.setScanActCount(actCount1);
|
|
|
|
@ -310,7 +301,7 @@ public class IoCollectOrderCodeManService extends ServiceImpl<IoCollectOrderCode
|
|
|
|
|
|
|
|
|
|
if (!IntUtil.value(addTagCodeReqeust.getInsert())) {
|
|
|
|
|
if (collectOrderBiz == null)
|
|
|
|
|
throw new JsonException(502, "非此单据追溯码!");
|
|
|
|
|
throw new JsonException(502, "非此单据追溯码,是否继续添加?");
|
|
|
|
|
int count1 = IntUtil.value(collectOrderBiz.getScanCount()) + 1;
|
|
|
|
|
int actCount1 = 0;
|
|
|
|
|
if (IntUtil.value(collectOrder.getOrderCirType()) == 1) {
|
|
|
|
@ -322,10 +313,10 @@ public class IoCollectOrderCodeManService extends ServiceImpl<IoCollectOrderCode
|
|
|
|
|
int needCount = IntUtil.value(collectOrderBiz.getCount()) - IntUtil.value(collectOrderBiz.getScanActCount());
|
|
|
|
|
if (needCount > 0) {
|
|
|
|
|
if (vailInSplit(collectOrderBiz, collectOrder.getWorkPlaceCode(), needCount)) {
|
|
|
|
|
throw new JsonException(502, "当前拆零数量还有剩余,是否继续扫码?");
|
|
|
|
|
throw new JsonException(502, collectOrderBiz.getCpmctymc() + "拆零数量还有剩余,是否继续添加?");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
throw new JsonException(502, "扫码数量超出!");
|
|
|
|
|
throw new JsonException(502, collectOrderBiz.getCpmctymc() + "扫码数量超出,是否继续添加");
|
|
|
|
|
}
|
|
|
|
|
collectOrderBiz.setScanCount(count1);
|
|
|
|
|
collectOrderBiz.setScanActCount(actCount1);
|
|
|
|
@ -481,4 +472,8 @@ public class IoCollectOrderCodeManService extends ServiceImpl<IoCollectOrderCode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Boolean removeByBillNo(String billNo) {
|
|
|
|
|
return remove(new LambdaQueryWrapper<IoCollectOrderCodeMan>().eq(IoCollectOrderCodeMan::getOrderIdFk, billNo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|