自动化立体仓库 - WMS系统
zyx
2023-10-04 45c2bf51fae3030c8e22fa2f2016b64a28928547
src/main/java/com/zy/asrs/service/impl/DocTypeServiceImpl.java
@@ -15,11 +15,17 @@
public class DocTypeServiceImpl extends ServiceImpl<DocTypeMapper, DocType> implements DocTypeService {
    @Override
    public DocType selectOrAdd(String docName) {
    public DocType selectOrAdd(String docName, Boolean pakin) {
        if (Cools.isEmpty(docName)) {
            return null;
        }
        DocType docType = this.selectOne(new EntityWrapper<DocType>().eq("doc_name", docName));
        DocType docType = null;
        try {
            docType = this.selectById(docName);
        } catch (Exception ignore) {}
        if (docType == null) {
            docType = this.selectOne(new EntityWrapper<DocType>().eq("doc_name", docName));
        }
        if (docType == null) {
            long docId = 1L;
            DocType last = this.selectOne(new EntityWrapper<DocType>().orderBy("doc_id", false));
@@ -29,6 +35,10 @@
            docType = new DocType();
            docType.setDocId(docId);
            docType.setDocName(docName);
            if (null != pakin) {
                docType.setPakin(pakin ? 1 : 0);
                docType.setPakout(pakin ? 0 : 1);
            }
            docType.setStatus(1);
            docType.setCreateTime(new Date());
            docType.setUpdateTime(new Date());