jiazx0107@163.com
2023-06-21 d320b9ae40b3dfc1942ea484c8893ba1404c73ec
调整卡回收页面操作逻辑
已修改19个文件
2083 ■■■■■ 文件已修改
igds-api-phone/src/main/java/com/ld/igds/phone/service/impl/ServiceImpl5205.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-api-phone/src/main/java/com/ld/igds/phone/service/impl/ServiceImpl5207.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/Phone35ServiceImpl5201.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/Phone35ServiceImpl5202.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/Phone35ServiceImpl5207.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-base/src/main/java/com/ld/igds/constant/RespCodeEnum.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java 1548 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/service/InoutService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/service/HLossOverService.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/resources/mapper/InoutRecordMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/static/admin/inout/in-card-back.js 99 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/static/img/areation/default/pfc2_a.png 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/static/img/areation/default/pfc2_b.png 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/static/img/areation/default/pfc_a.png 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/static/img/areation/default/pfc_b.png 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/templates/admin/inout/in-card-back.html 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/verb-conf.properties 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-api-phone/src/main/java/com/ld/igds/phone/service/impl/ServiceImpl5205.java
@@ -79,8 +79,11 @@
            files.add(fileData1);
            files.add(fileData2);
            data.setFiles(files);
            //进行下一流程更新
            PageResponse<InoutData> stringPageResponse = inoutManager.inNextStep(data);
            PageResponse<InoutData> stringPageResponse = inoutManager.submitHandle(data);
          //  PageResponse<InoutData> stringPageResponse = inoutManager.inNextStep(data);
            return PhoneRespUtil.success(stringPageResponse.getData(), req);
        }
igds-api-phone/src/main/java/com/ld/igds/phone/service/impl/ServiceImpl5207.java
@@ -58,15 +58,15 @@
        InoutData data = inoutMapper.inoutQueryById(inoutParam);
        //判断单子是否在值仓流程
        if(!data.getProgress().equals(InoutConstant.PROGRESS_HANDLE)){
            return PhoneRespUtil.error(RespCodeEnum.CODE_2000,"该单子不在值仓状态,不能进行值仓提交!");
        if (!data.getProgress().equals(InoutConstant.PROGRESS_HANDLE)) {
            return PhoneRespUtil.error(RespCodeEnum.CODE_2000, "该单子不在值仓状态,不能进行值仓提交!");
        }
        if(param.getType().equals(PhoneConstant.PHONE_INOUT_START)){
        if (param.getType().equals(PhoneConstant.PHONE_INOUT_START)) {
            //值仓开始提交,只更新值仓开始时间
            String msg = inoutService.updateData(data);
            return PhoneRespUtil.success(msg, req);
        }else{
        } else {
            //值仓结束提交,需更新流程状态、值仓结束时间、值仓人、值仓扣重等
            data.setDeHandle(param.getDeHandle());
            data.setHandleUser(authUser.getCname());
@@ -80,7 +80,9 @@
            files.add(fileData2);
            data.setFiles(files);
            //进行下一流程更新
            PageResponse<InoutData> stringPageResponse = inoutManager.inNextStep(data);
            //  PageResponse<InoutData> stringPageResponse = inoutManager.inNextStep(data);
            PageResponse<InoutData> stringPageResponse = inoutManager.submitHandle(data);
            return PhoneRespUtil.success(stringPageResponse.getData(), req);
        }
igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/Phone35ServiceImpl5201.java
@@ -63,7 +63,9 @@
        data.setRegisterTime(new Date());
        data.setRegisterUser(phone35AuthUser.getCname());
        data.setProgress(InoutConstant.PROGRESS_REGISTER);
        PageResponse<InoutData> result = inoutManager.inNextStep(data);
        PageResponse<InoutData> result = inoutManager.submitRegisterInout(data);
        //PageResponse<InoutData> result = inoutManager.inNextStep(data);
        if (RespCodeEnum.CODE_0000.getCode().equals(result.getCode())) {
            return PhoneRespUtil.success("入库登记成功!", req);
igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/Phone35ServiceImpl5202.java
@@ -64,7 +64,7 @@
        data.setRegisterTime(new Date());
        data.setRegisterUser(phone35AuthUser.getCname());
        data.setProgress(InoutConstant.PROGRESS_REGISTER);
        PageResponse<InoutData> result = inoutManager.outNextStep(data);
        PageResponse<InoutData> result = inoutManager.submitRegisterInout(data);
        if (RespCodeEnum.CODE_0000.getCode().equals(result.getCode())) {
            return PhoneRespUtil.success("出库登记成功!", req);
igds-api-phone/src/main/java/com/ld/igds/phone35/service/impl/Phone35ServiceImpl5207.java
@@ -87,8 +87,10 @@
            files.add(fileData2);
            //TODO 设置水印
            data.setFiles(files);
            PageResponse<InoutData> stringPageResponse = inoutManager.submitHandle(data);
            //进行下一流程更新
            PageResponse<InoutData> stringPageResponse = inoutManager.inNextStep(data);
           // PageResponse<InoutData> stringPageResponse = inoutManager.inNextStep(data);
            return PhoneRespUtil.success(stringPageResponse.getData(), req);
        }
igds-base/src/main/java/com/ld/igds/constant/RespCodeEnum.java
@@ -16,7 +16,6 @@
     */
    CODE_0000("0000", "成功"),
    CODE_1111("1111", "后端服务异常"),
    CODE_1001("1001","数据格式校验失败"),
    CODE_1002("1002","该应用无激活授权"),
    CODE_1003("1003","该应用已经授权成功"),
@@ -24,7 +23,7 @@
    CODE_1005("1005","该设备不存在"),
    CODE_1006("1006","当前登录人已掉线"),
    CODE_1007("1007","请求参数异常"),
    CODE_1008("1008","业务数据返回为空"),
    CODE_1008("1008","流程不正确"),
    CODE_2000("2000","响应数据为空")
    ;
igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java
@@ -537,7 +537,7 @@
    }
    /**
     * 卡回收数据查询,没有流程状态的数据直接返回
     * 出库收卡信息查询
     *
     * @param param
     * @return
@@ -545,41 +545,7 @@
    @RequestMapping("/inout-query-back")
    public PageResponse<InoutData> inoutQueryBack(@RequestBody InoutParam param) {
        param.setProgress(null);
        return inoutManager.inoutQuery(param);
    }
    /**
     * 出入库数据更新,提交到下个流程
     *
     * @param data
     * @return
     */
    @RequestMapping("/inout-next-step")
    @Transactional
    public PageResponse<InoutData> inoutNextStep(@RequestBody InoutData data) {
        try {
            IUser user = ContextUtil.getLoginUser();
            if (StringUtils.isEmpty(data.getCompanyId())) {
                data.setCompanyId(user.getCompanyId());
            }
            if (StringUtils.isEmpty(data.getDeptId())) {
                data.setDeptId(ContextUtil.subDeptId(user));
            }
            if (InoutConstant.TYPE_IN.equals(data.getType())) {
                return inoutManager.inNextStep(data);
            } else {
                return inoutManager.outNextStep(data);
            }
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            //手动回滚
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage());
        }
        return inoutManager.inoutQueryBack(param);
    }
    /**
@@ -639,32 +605,16 @@
    }
    /**
     * 卡回收页面提交,如果是正常流程卡回收则走正常完成流程,否则执行删除逻辑并回收卡
     * 出入库卡回收提交,如果数据已经是完成,直接不做更新,如果未完成则执行完成
     *
     * @param data
     * @return
     */
    @RequestMapping("/inout-back-submit")
    public PageResponse<InoutData> inoutBackSubmit(@RequestBody InoutData data) {
        return inoutManager.inoutBack(data);
    @RequestMapping("/submit-card-back")
    @Transactional
    public PageResponse<InoutData> submitCardBack(@RequestBody InoutData data) throws Exception {
        return inoutManager.submitCardBack(data);
    }
//    /**
//     * 化验页面数据提交
//     *
//     * @param data
//     * @return
//     */
//    @RequestMapping("/update-check")
//    public PageResponse<InoutData> updateCheck(@RequestBody InoutData data) {
//        try {
//            return inoutManager.updateCheck(data);
//        } catch (Exception e) {
//            log.error("后台异常:{}", e);
//            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
//                    "后台异常:" + e.getMessage(), null);
//        }
//    }
    /**
     * 根据卡号和类型,直接完成当前流程
@@ -672,57 +622,10 @@
     * @param data
     * @return
     */
    @RequestMapping("/inout-to-complete")
    public PageResponse<InoutData> inoutComplete(@RequestBody InoutData data) {
        try {
            return inoutManager.inoutComplete(data);
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage(), data);
        }
    }
//    /**
//     * 根据入库数据信息,获取检查项信息,如果当前数据已经检测完成,查询检测结果,如果没有检测完成则根据检测项配置获取需要检测的项目信息
//     *
//     * @param data
//     * @return
//     */
//    @RequestMapping("/get-check-item")
//    public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutData data) {
//        try {
//            return inoutManager.getCheckItem(data);
//        } catch (Exception e) {
//            log.error("后台异常:{}", e);
//            return new PageResponse<List<CheckItemData>>(
//                    RespCodeEnum.CODE_1111.getCode(), "后台异常:" + e.getMessage());
//        }
//    }
//    /**
//     * 分页获取数据信息
//     *
//     * @param param
//     * @return
//     */
//    @RequestMapping("/page-check-data")
//    public PageResponse<Page<InoutData>> pageCheckData(
//            @RequestBody InoutParam param) {
//        return inoutManager.pageCheckData(param);
//    }
    /**
     * 道闸控制
     *
     * @param param
     * @return
     */
    @RequestMapping("/gate-ctrl")
    public PageResponse<String> gateCtrl(
            @RequestBody InoutGateDto param) {
        return null;
    @RequestMapping("/submit-complete")
    @Transactional
    public PageResponse<InoutData> submitComplete(@RequestBody InoutData data) throws Exception {
        return inoutManager.submitComplete(data);
    }
    /**
@@ -869,6 +772,7 @@
    /**
     * 根据粮食等级及粮食品种获取粮食定价
     *
     * @param param
     * @return
     */
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutManager.java
@@ -1,6 +1,5 @@
package com.ld.igds.inout.manager;
import com.bstek.bdf2.core.business.IUser;
import com.ld.igds.check.CheckStandardManager;
import com.ld.igds.check.dto.CheckItemData;
import com.ld.igds.check.dto.CheckUpdateResult;
@@ -9,9 +8,11 @@
import com.ld.igds.data.Page;
import com.ld.igds.data.PageResponse;
import com.ld.igds.file.CoreFileService;
import com.ld.igds.file.dto.FileData;
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.inout.dto.*;
import com.ld.igds.inout.dto.InoutCheckData;
import com.ld.igds.inout.dto.InoutCheckParam;
import com.ld.igds.inout.dto.InoutData;
import com.ld.igds.inout.dto.InoutParam;
import com.ld.igds.inout.service.InoutService;
import com.ld.igds.m.service.InoutCommonService;
import com.ld.igds.models.Depot;
@@ -20,15 +21,16 @@
import com.ld.igds.models.InoutSysConf;
import com.ld.igds.util.ContextUtil;
import com.ld.igds.util.DateUtil;
import com.ld.igds.util.NumberUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -42,18 +44,57 @@
@Component
public class InoutManager {
    @Autowired
    @Resource
    private InoutService inoutService;
    @Autowired
    @Resource
    private CoreFileService fileService;
    @Autowired
    @Resource
    private CoreCommonService commonService;
    @Resource
    private InoutCommonService inoutCommonService;
    @Autowired
    @Resource
    private CheckStandardManager checkStandardManager;
    @Resource
    private InoutDeviceManager inoutDeviceManager;
    /**
     * 直接从数据库查询,不考虑信息状态
     *
     * @param param
     * @return
     */
    public PageResponse<InoutData> inoutQueryBack(InoutParam param) {
        if (StringUtils.isEmpty(param.getPlateNum())
                && StringUtils.isEmpty(param.getIntelCard())
                && StringUtils.isEmpty(param.getUserId())) {
            return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
                    "查询参数不完整,查询失败!");
        }
        //获取三天以内最后一天记录
        param.setStart(DateUtil.getNewByDay(new Date(), -3));
        param.setType(null);
        param.setProgress(null);
        InoutData result = inoutService.getLastRecord(param);
        if (null == result) {
            return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
                    "根据当前条件未查询到车辆信息!");
        }
        if (InoutConstant.PROGRESS_RECORD.equals(result.getProgress())) {
            return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "当前车辆流程已经结束", result);
        }
        if (!InoutConstant.PROGRESS_CARD_BACK.equals(result.getProgress())) {
            return new PageResponse<>(RespCodeEnum.CODE_1008.getCode(), "当前车辆流程不在当前环节,无法执行出库", result);
        }
        return new PageResponse<>(RespCodeEnum.CODE_0000, result);
    }
    /**
     * 首先从缓存中获取,缓存中,从数据库中获取
@@ -126,153 +167,6 @@
        }
    }
    public PageResponse<InoutData> outNextStep(InoutData data) throws Exception {
        String msg;
        IUser user = ContextUtil.getLoginUser();
        if (StringUtils.isEmpty(data.getCompanyId())) {
            data.setCompanyId(user.getCompanyId());
        }
        if (StringUtils.isEmpty(data.getDeptId())) {
            data.setDeptId(ContextUtil.subDeptId(user));
        }
        if (StringUtils.isEmpty(data.getIntelCard())) {
            data.setIntelCard(data.getUserId());
        }
        String curProgress = data.getProgress();
        List<FileData> files = data.getFiles();
        // 更新下一个状态和基本信息
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(
                data.getCompanyId(), data.getDeptId());
        if (null == inoutSysConf
                || StringUtils.isEmpty(inoutSysConf.getProgressIn())) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "当前库区未配置出库流程信息,请联系管理员配置。", data);
        }
        data = updateBasicInfo(data, inoutSysConf);
        // 如果当前节点是注册,则需要验证下,是否有为完成的流程在执行中
        if (InoutConstant.PROGRESS_REGISTER.equals(curProgress)) {
            InoutData progressData = this.inoutProgressQuery(data);
            if (null != progressData) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "当前卡片/车牌号有流程未结束。", progressData);
            }
        }
        if (null != data.getPrice() && null != data.getRecordWeight()) {
            data.setSettleMoney(NumberUtil.keepPrecision(data.getPrice() * data.getRecordWeight(), 2));
        }
        // 流程完成,直接调用流程完成接口
        if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            inoutService.updateData(data);
            // 执行附件信息
            if (null != files) {
                fileService.saveInoutFiles(files, data.getCompanyId(),
                        data.getId(), curProgress);
            }
            // 通知称重主控流程结束
            inoutDeviceManager.noticeProgressComplete(data);
            return inoutComplete(data);
        }
        // 调用保存方法执行
        if (StringUtils.isEmpty(data.getId())) {
            msg = inoutService.insertData(data);
        } else {
            msg = inoutService.updateData(data);
        }
        // 执行附件信息
        if (null != files) {
            fileService.saveInoutFiles(files, data.getCompanyId(),
                    data.getId(), curProgress);
        }
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg,
                    data);
        }
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功",
                data);
    }
    public PageResponse<InoutData> inNextStep(InoutData data) throws Exception {
        String msg;
        String curProgress = data.getProgress();
        List<FileData> files = data.getFiles();
        if (StringUtils.isEmpty(data.getIntelCard())) {
            data.setIntelCard(data.getUserId());
        }
        // 更新下一个状态和基本信息
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
        if (null == inoutSysConf
                || StringUtils.isEmpty(inoutSysConf.getProgressIn())) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "当前库区未配置入库流程信息,请联系管理员配置。", data);
        }
        data = updateBasicInfo(data, inoutSysConf);
        // 如果当前节点是注册,则需要验证下,是否有为完成的流程在执行中
        if (InoutConstant.PROGRESS_REGISTER.equals(curProgress)) {
            InoutData progressData = this.inoutProgressQuery(data);
            if (null != progressData) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "当前卡片/车牌号有流程未结束。", progressData);
            }
        }
        if (null != data.getPrice() && null != data.getRecordWeight()) {
            data.setSettleMoney(NumberUtil.keepPrecision(data.getPrice() * data.getRecordWeight(), 2));
        }
        // 流程完成,直接调用流程完成接口
        if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            if (StringUtils.isEmpty(data.getCompanyId())) {
                data.setCompanyId(ContextUtil.getCompanyId());
            }
            inoutService.updateData(data);
            // 执行附件信息
            if (null != files) {
                fileService.saveInoutFiles(files, data.getCompanyId(),
                        data.getId(), curProgress);
            }
            // 通知称重主控流程结束
            inoutDeviceManager.noticeProgressComplete(data);
            return inoutComplete(data);
        }
        // 调用保存方法执行
        if (StringUtils.isEmpty(data.getId())) {
            msg = inoutService.insertData(data);
        } else {
            msg = inoutService.updateData(data);
        }
        // 执行附件信息
        if (null != files) {
            fileService.saveInoutFiles(files, data.getCompanyId(),
                    data.getId(), curProgress);
        }
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg);
        }
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功",
                data);
    }
    public InoutData inoutProgressQuery(InoutData data) throws Exception {
        InoutParam param = new InoutParam();
@@ -283,85 +177,6 @@
        return inoutService.inoutProgressQuery(param);
    }
//    @Transactional(rollbackFor = Exception.class)
//    public PageResponse<InoutData> updateCheck(InoutData data) throws Exception {
//
//        if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
//            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
//                    "当前流程已经结束,不支持修改", data);
//        }
//
//        CheckUpdateResult checkResult = this.updateCheckItems(data);
//        String tag = checkResult.getMsg();
//
//        if (null != tag) {
//            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
//                    "后台执行异常:" + tag, data);
//        }
//
//        // 获取业务数据信息
//        InoutParam param = new InoutParam();
//        param.setCompanyId(data.getCompanyId());
//        param.setId(data.getId());
//        InoutData progressData = inoutService.inoutProgressQuery(param);
//        if (null == progressData) {
//            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
//                    "没有获取到出入库业务数据信息,更新失败", data);
//        }
//        if (InoutConstant.PROGRESS_RECORD.equals(progressData.getProgress())) {
//            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
//                    "当前流程已经结束,不支持修改");
//        }
//        progressData.setCheckStatus(data.getCheckStatus());
//
//        // 更新下一个状态和基本信息
//        if (InoutConstant.PROGRESS_CHECK.equals(progressData.getProgress())) {
//            progressData = updateBasicInfo(progressData, null);
//            // 若化验结果不合格,判断配置后续流程
//            if (InoutConstant.STATUS_UNPASS.equals(progressData
//                    .getCheckStatus())) {
//                progressData = checkNoPass(progressData);
//            }
//        }
//        progressData.setCheckUser(ContextUtil.getLoginUserCName());
//
//        if (StringUtils.isNotEmpty(data.getDepotId())) {
//            progressData.setDepotId(data.getDepotId());
//        }
//        if (StringUtils.isNotEmpty(data.getFoodVariety())) {
//            progressData.setFoodVariety(data.getFoodVariety());
//        }
//        if (StringUtils.isNotEmpty(data.getFoodLevel())) {
//            progressData.setFoodLevel(data.getFoodLevel());
//        }
//        if (StringUtils.isNotEmpty(data.getFoodLocation())) {
//            progressData.setFoodLocation(data.getFoodLocation());
//        }
//        if (StringUtils.isNotEmpty(data.getFoodYear())) {
//            progressData.setFoodYear(data.getFoodYear());
//        }
//        if (null != data.getPrice()) {
//            progressData.setPrice(data.getPrice());
//        }
//        if (StringUtils.isNotEmpty(data.getRemarks())) {
//            progressData.setRemarks(data.getRemarks());
//        }
//        if (StringUtils.isNotEmpty(data.getNoticeId())) {
//            progressData.setNoticeId(data.getNoticeId());
//        }
//
//        String msg = inoutService.updateData(progressData);
//
//        if (null != msg) {
//            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg);
//        }
//        if (InoutConstant.PROGRESS_RECORD.equals(progressData.getProgress())) {
//
//            inoutComplete(progressData);
//        }
//        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功");
//    }
    /**
     * 化验结果不通过时校验配置信息
@@ -556,81 +371,45 @@
    }
    public PageResponse<InoutData> inoutComplete(InoutData data) throws Exception {
    public PageResponse<InoutData> submitComplete(InoutData data) throws Exception {
        if (StringUtils.isEmpty(data.getId())
                || StringUtils.isEmpty(data.getType())) {
                || StringUtils.isEmpty(data.getType())
                || StringUtils.isEmpty(data.getProgress())) {
            return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(),
                    "没有获取到车辆信息。", data);
        }
        data.setUpdateTime(new Date());
        if (null == data.getCompleteTime()) {
            data.setCompleteTime(DateUtil.getNewByMinute(new Date(), 2));
        }
        if (null == data.getCompleteUser()) {
            data.setCompleteUser(ContextUtil.getLoginUserCName());
        }
        // 设置流程节点直接完成
        InoutParam param = new InoutParam();
        param.setCompanyId(data.getCompanyId());
        param.setId(data.getId());
        param.setType(data.getType());
        param.setDeptId(data.getDeptId());
        param.setIntelCard(data.getIntelCard());
        param.setUserId(ContextUtil.getLoginUserCName());
        param.setUserId(data.getCompleteUser());
        param.setDepotId(data.getDepotId());
        param.setCompleteTime(data.getCompleteTime());
        if (null == param.getCompleteTime()) {
            param.setCompleteTime(new Date());
        }
        // 设置流程节点直接完成
        param.setProgress(InoutConstant.PROGRESS_RECORD);
        if (null == data.getCompleteTime()) {
            data.setCompleteTime(DateUtil.getNewByMinute(new Date(), 2));
        }
        String msg = inoutService.toComplete(param);
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg);
        }
        // 库存调整
        commonService.initInoutDepotStore(data);
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), null, data);
    }
//    /**
//     * 扦样化验页面获取检验项条目信息
//     *
//     * @param data
//     * @return
//     */
//    public PageResponse<List<CheckItemData>> getCheckItem(InoutData data) {
//
//        List<CheckItemData> result = checkStandardManager.listCheckItem(
//                data.getCheckId(), data.getCompanyId(), data.getDeptId(),
//                data.getFoodVariety());
//
//        return new PageResponse<>(RespCodeEnum.CODE_0000, result);
//    }
    /**
     * 删除并完成
     *
     * @param data
     * @return
     */
    public PageResponse<InoutData> deleteInoutData(InoutData data, String msg) {
        try {
            data.setRemarks(msg);
            String result = this.delInoutData(data, false);
            if (null != result) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        result, data);
            }
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "后台异常:"
                    + e.getMessage(), data);
        }
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行完成",
                data);
    }
    /**
@@ -639,619 +418,333 @@
     * @param data
     * @return
     */
    public PageResponse<InoutData> inoutBack(InoutData data) {
    public PageResponse<InoutData> submitCardBack(InoutData data) {
        try {
            // 从缓存中获取最新的数据,如果没有则表示流程已经结束。
            InoutParam param = new InoutParam();
            param.setCompanyId(data.getCompanyId());
            param.setId(data.getId());
            InoutData curData = inoutService.inoutProgressQuery(param);
            if (InoutConstant.PROGRESS_RECORD.equals(curData.getProgress())) {
                return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                        "当前卡流程已经完成,无需执行卡回收", data);
            //如果当前数据已经结束
            if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
                //删除缓存
                inoutService.delFromCache(data.getDeptId(), data.getType(), data.getId());
                return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(),
                        "当车辆流程已经完成,卡片已回收", data);
            }
            if (InoutConstant.RECORD_STATUS_DEL.equals(curData
                    .getRecordStatus())) {
                return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                        "当前卡信息已被删除,不能执行卡回收", data);
            //如果当前流程不是卡回收
            if (!InoutConstant.PROGRESS_CARD_BACK.equals(data.getProgress())) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "当前流程环节不正确,不能执行卡回收", data);
            }
            // 如果当前流程状态是卡回收状态,就是完成流程。
            if (InoutConstant.PROGRESS_CARD_BACK.equals(curData.getProgress())) {
                return inoutComplete(curData);
            if (InoutConstant.PROGRESS_CARD_BACK.equals(data.getProgress())) {
                return submitComplete(data);
            }
            // 如果是其他状态,则执行删除逻辑
            return deleteInoutData(curData, "卡回收删除");
        } catch (Exception e) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后端执行异常:" + e.getMessage());
        }
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(),
                "执行成功", data);
    }
    /* ============================== 详单页面相关操作 ================================= */
    /**
     * 补单操作 补单因为完成时间不确定,所以需要系统根据当前数据进行自动检测,调整原来流水信息和库存
     *
     * @param data
     * @return
     * @throws Exception
     */
    @Transactional
    public String addInoutData(InoutData data) throws Exception {
        /**
         * 补单操作 补单因为完成时间不确定,所以需要系统根据当前数据进行自动检测,调整原来流水信息和库存
         *
         * @param data
         * @return
         * @throws Exception
         */
        public String addInoutData(InoutData data) throws Exception {
        if (data.getSettleWeight() <= 0.0) {
            return "补单数据要求结算重量必须大于0";
        }
        // 补单数据直接到结果状态
        data.setRecordStatus(InoutConstant.RECORD_STATUS_ADD);
        data.setProgress(InoutConstant.PROGRESS_RECORD);
        if (InoutConstant.STATUS_NONE.equals(data.getCheckStatus())) {
            data.setCheckStatus(InoutConstant.STATUS_PASS);
        }
        String loginUser = ContextUtil.getLoginUserCName();
        data.setRegisterUser(loginUser);
        data.setFullWeightUser(loginUser);
        data.setEmptyWeightUser(loginUser);
        data.setHandleUser(loginUser);
        data.setCompleteUser(loginUser);
        if (null == data.getCompleteTime()) {
            data.setCompleteTime(new Date());
        }
        // 注册时间比完成时间早一个小时
        data.setRegisterTime(DateUtil.getNewByMinute(new Date(), -60));
        if (StringUtils.isEmpty(data.getUserId())) {
            data.setUserId(InoutConstant.DEFAULT_ID_CARD);
        }
        if (null == data.getIntelCard()) {
            data.setIntelCard(data.getUserId());
        }
        if (null != data.getCheckItems()) {
            data.setCheckUser(loginUser);
        }
        // 保存检测项目
        if (InoutConstant.TYPE_IN.equals(data.getType())) {
            if (null == data.getFullWeightTime()) {
                data.setFullWeightTime(DateUtil.getNewByMinute(new Date(), -50));
            }
            if (null == data.getEmptyWeightTime()) {
                data.setEmptyWeightTime(DateUtil.getNewByMinute(new Date(), -10));
            if (data.getSettleWeight() <= 0.0) {
                return "补单数据要求结算重量必须大于0";
            }
            // 先执行化验信息保存
            CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
            if (null != checkResult) {
            // 补单数据直接到结果状态
            data.setRecordStatus(InoutConstant.RECORD_STATUS_ADD);
            data.setProgress(InoutConstant.PROGRESS_RECORD);
            if (InoutConstant.STATUS_NONE.equals(data.getCheckStatus())) {
                data.setCheckStatus(InoutConstant.STATUS_PASS);
            }
            String loginUser = ContextUtil.getLoginUserCName();
            data.setRegisterUser(loginUser);
            data.setFullWeightUser(loginUser);
            data.setEmptyWeightUser(loginUser);
            data.setHandleUser(loginUser);
            data.setCompleteUser(loginUser);
            if (null == data.getCompleteTime()) {
                data.setCompleteTime(new Date());
            }
            // 注册时间比完成时间早一个小时
            data.setRegisterTime(DateUtil.getNewByMinute(new Date(), -60));
            if (StringUtils.isEmpty(data.getUserId())) {
                data.setUserId(InoutConstant.DEFAULT_ID_CARD);
            }
            if (null == data.getIntelCard()) {
                data.setIntelCard(data.getUserId());
            }
            if (null != data.getCheckItems()) {
                data.setCheckUser(loginUser);
            }
            // 保存检测项目
            if (InoutConstant.TYPE_IN.equals(data.getType())) {
                if (null == data.getFullWeightTime()) {
                    data.setFullWeightTime(DateUtil.getNewByMinute(new Date(), -50));
                }
                if (null == data.getEmptyWeightTime()) {
                    data.setEmptyWeightTime(DateUtil.getNewByMinute(new Date(), -10));
                }
                // 先执行化验信息保存
                CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
                if (null != checkResult) {
//                if (null == data.getWet())data.setWet(checkResult.getWet());
//                if (null == data.getImpurity())data.setImpurity(checkResult.getImpurity());
                }
            } else {
                if (null == data.getEmptyWeightTime()) {
                    data.setEmptyWeightTime(DateUtil.getNewByMinute(new Date(), -50));
                }
                if (null == data.getFullWeightTime()) {
                    data.setFullWeightTime(DateUtil.getNewByMinute(new Date(), -10));
                }
            }
        } else {
            if (null == data.getEmptyWeightTime()) {
                data.setEmptyWeightTime(DateUtil.getNewByMinute(new Date(), -50));
            // 添加补单数据
            String msg = inoutService.insertData(data);
            // 初始化验证出入库库存
            commonService.initInoutDepotStore(data);
            return msg;
        }
        /**
         * 修改操作 修改逻辑说明:修改数据需要获取原数据库中的数据进行对比。
         *
         * @param data
         * @return
         * @throws Exception
         */
        @Transactional
        public String updateInoutData(InoutData data)throws Exception {
            if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) {
                return "系统:已经删除的数据不支持修改!";
            }
            if (null == data.getFullWeightTime()) {
                data.setFullWeightTime(DateUtil.getNewByMinute(new Date(), -10));
            if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) {
                return "系统:异常终止的数据不支持修改!";
            }
        }
        // 添加补单数据
        String msg = inoutService.insertData(data);
            // 如果流程未结束,只更新数据
            if (!InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
                return inoutService.updateData(data);
            }
        // 初始化验证出入库库存
        commonService.initInoutDepotStore(data);
        return msg;
    }
            // 如果是已经完成的数据,先获取到修改直接的数据根据数据进行对比
            InoutParam param = new InoutParam();
            param.setId(data.getId());
            param.setCompanyId(data.getCompanyId());
            param.setType(data.getType());
            InoutData record = inoutService.inoutQueryById(param);
    /**
     * 修改操作 修改逻辑说明:修改数据需要获取原数据库中的数据进行对比。
     *
     * @param data
     * @return
     * @throws Exception
     */
    @javax.transaction.Transactional(rollbackOn = Exception.class)
    public String updateInoutData(InoutData data) throws Exception {
            if (null == record) {
                return "当前修改数据已经不存在!";
            }
        if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) {
            return "系统:已经删除的数据不支持修改!";
        }
        if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) {
            return "系统:异常终止的数据不支持修改!";
        }
            // 避免数据库中的数据已经被其他人修改
            if (InoutConstant.RECORD_STATUS_DEL.equals(record.getRecordStatus())) {
                return "系统:已经删除的数据不支持修改!";
            }
            if (InoutConstant.RECORD_STATUS_ERROR.equals(record.getRecordStatus())) {
                return "系统:异常终止的数据不支持修改!";
            }
        // 如果流程未结束,只更新数据
        if (!InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            return inoutService.updateData(data);
        }
        // 如果是已经完成的数据,先获取到修改直接的数据根据数据进行对比
        InoutParam param = new InoutParam();
        param.setId(data.getId());
        param.setCompanyId(data.getCompanyId());
        param.setType(data.getType());
        InoutData record = inoutService.inoutQueryById(param);
        if (null == record) {
            return "当前修改数据已经不存在!";
        }
        // 避免数据库中的数据已经被其他人修改
        if (InoutConstant.RECORD_STATUS_DEL.equals(record.getRecordStatus())) {
            return "系统:已经删除的数据不支持修改!";
        }
        if (InoutConstant.RECORD_STATUS_ERROR.equals(record.getRecordStatus())) {
            return "系统:异常终止的数据不支持修改!";
        }
        // 保存检测项目
        if (InoutConstant.TYPE_IN.equals(data.getType())) {
            // 先执行化验信息保存
            CheckUpdateResult checkResult = checkStandardManager
                    .updateCheckItems(data.getCheckId(), data.getCompanyId(),
                            data.getCheckItems());
            if (null != checkResult) {
            // 保存检测项目
            if (InoutConstant.TYPE_IN.equals(data.getType())) {
                // 先执行化验信息保存
                CheckUpdateResult checkResult = checkStandardManager
                        .updateCheckItems(data.getCheckId(), data.getCompanyId(),
                                data.getCheckItems());
                if (null != checkResult) {
//                if (null == data.getWet())
//                    data.setWet(checkResult.getWet());
//                if (null == data.getImpurity())
//                    data.setImpurity(checkResult.getImpurity());
                }
            }
            // 更新数据
            inoutService.updateData(data);
            return null;
        }
        // 更新数据
        inoutService.updateData(data);
        return null;
    }
    /**
     * 删除操作 删除数据为软删除,删除数据后需要根据删除情况联动库存等信息
     *
     * @param data
     * @param selected 是否已经查询过数据
     * @return
     * @throws Exception
     */
    @Transactional
    public String delInoutData(InoutData data, boolean selected)
        /**
         * 删除操作 删除数据为软删除,删除数据后需要根据删除情况联动库存等信息
         *
         * @param data
         * @param selected 是否已经查询过数据
         * @return
         * @throws Exception
         */
        @Transactional
        public String delInoutData (InoutData data,boolean selected)
            throws Exception {
        // 避免页面缓存首先获取数据库中最新的当前数据信息
        InoutParam param = new InoutParam();
        param.setCompanyId(data.getCompanyId());
        param.setId(data.getId());
        param.setMsg(" [" + ContextUtil.getLoginUserCName() + "]执行删除,原因:"
                + data.getRemarks());
            // 避免页面缓存首先获取数据库中最新的当前数据信息
            InoutParam param = new InoutParam();
            param.setCompanyId(data.getCompanyId());
            param.setId(data.getId());
            param.setMsg(" [" + ContextUtil.getLoginUserCName() + "]执行删除,原因:"
                    + data.getRemarks());
        if (!selected) {
            if (!selected) {
                data = inoutService.inoutQueryById(param);
                if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) {
                    return "已经删除的数据,不支持重复删除!";
                }
                if (InoutConstant.RECORD_STATUS_ERROR
                        .equals(data.getRecordStatus())) {
                    return "当前数据已经被标记为异常,不支持删除!";
                }
            }
            // 执行删除
            param.setProgress(InoutConstant.PROGRESS_RECORD);
            param.setRecordStatus(InoutConstant.RECORD_STATUS_DEL);
            param.setType(data.getType());
            inoutService.deleteData(param);
            // 如果流程未结束,直接删除,不牵扯到联动调整
            if (!InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
                return null;
            }
            return null;
        }
        /**
         * 异常终止操作 设置异常 为了避免页面数据缓存,需要重新获取最新数据判断
         *
         * @param data
         * @return
         * @throws Exception
         */
        @Transactional
        public String errorInoutData (InoutData data){
            InoutParam param = new InoutParam();
            param.setCompanyId(data.getCompanyId());
            param.setId(data.getId());
            param.setMsg(" [" + ContextUtil.getLoginUserCName() + "]执行异常终止,原因:"
                    + data.getRemarks());
            data = inoutService.inoutQueryById(param);
            if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) {
                return "已经删除的数据,不支持重复删除!";
                return "已经删除的数据,不支持异常处理!";
            }
            if (InoutConstant.RECORD_STATUS_ERROR
                    .equals(data.getRecordStatus())) {
                return "当前数据已经被标记为异常,不支持删除!";
            if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) {
                return "不支持重复异常处理!";
            }
            if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
                return "流程结束的数据不支持异常处理!";
            }
            return inoutService.inoutStop(param);
        }
        // 执行删除
        param.setProgress(InoutConstant.PROGRESS_RECORD);
        param.setRecordStatus(InoutConstant.RECORD_STATUS_DEL);
        param.setType(data.getType());
        inoutService.deleteData(param);
        /**
         * 快速结束操作 流程没有结束的单据进行结束
         *
         * @param data
         * @return
         */
        public String completeInoutData (InoutData data) throws Exception {
            if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) {
                return "已经删除的数据,不支持完成!";
            }
            if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) {
                return "异常终止的数据,不支持完成!";
            }
            if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
                return "流程已完成的数据,不支持完成!";
            }
        // 如果流程未结束,直接删除,不牵扯到联动调整
        if (!InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            return null;
        }
        return null;
    }
            // 从新查询数据
            InoutParam param = new InoutParam();
            param.setId(data.getId());
            param.setCompanyId(data.getCompanyId());
            param.setType(data.getType());
            InoutData cuData = inoutService.inoutProgressQuery(param);
            if (null == cuData) {
                return "当前车辆流程状态已经变化,请刷新页面重新操作!";
            }
            if (!cuData.getProgress().equals(data.getProgress())) {
                return "当前车辆流程状态已经变化,请刷新页面重新操作!";
            }
    /**
     * 异常终止操作 设置异常 为了避免页面数据缓存,需要重新获取最新数据判断
     *
     * @param data
     * @return
     * @throws Exception
     */
    @Transactional
    public String errorInoutData(InoutData data) {
            if (null == data.getCompleteTime()) {
                return "请填写完成时间!!";
            }
            if (StringUtils.isEmpty(data.getDepotId())) {
                return "请填写仓库信息!";
            }
            if (StringUtils.isEmpty(data.getFoodYear())) {
                return "请填写粮食年份信息!";
            }
            if (StringUtils.isEmpty(data.getFoodVariety())) {
                return "请填写粮食品种信息!";
            }
        InoutParam param = new InoutParam();
        param.setCompanyId(data.getCompanyId());
        param.setId(data.getId());
        param.setMsg(" [" + ContextUtil.getLoginUserCName() + "]执行异常终止,原因:"
                + data.getRemarks());
        data = inoutService.inoutQueryById(param);
            if (data.getSettleWeight() <= 0) {
                return "请填写结算净重信息!";
            }
        if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) {
            return "已经删除的数据,不支持异常处理!";
        }
        if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) {
            return "不支持重复异常处理!";
        }
        if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            return "流程结束的数据不支持异常处理!";
            String msg = inoutService.quickComplete(data);
            if (null == msg) {
                data.setProgress(InoutConstant.PROGRESS_RECORD);
                commonService.initInoutDepotStore(data);
            }
            return msg;
        }
        return inoutService.inoutStop(param);
    }
    /**
     * 快速结束操作 流程没有结束的单据进行结束
     *
     * @param data
     * @return
     */
    public String completeInoutData(InoutData data) throws Exception {
        if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) {
            return "已经删除的数据,不支持完成!";
        }
        if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) {
            return "异常终止的数据,不支持完成!";
        }
        if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            return "流程已完成的数据,不支持完成!";
        public void initLpr (InoutConf conf){
            inoutDeviceManager.initLpr(conf);
        }
        // 从新查询数据
        InoutParam param = new InoutParam();
        param.setId(data.getId());
        param.setCompanyId(data.getCompanyId());
        param.setType(data.getType());
        InoutData cuData = inoutService.inoutProgressQuery(param);
        if (null == cuData) {
            return "当前车辆流程状态已经变化,请刷新页面重新操作!";
        }
        if (!cuData.getProgress().equals(data.getProgress())) {
            return "当前车辆流程状态已经变化,请刷新页面重新操作!";
        }
        /**
         * 出入库注册数据提交,入库登记和出入库登记使用同一个方法
         *
         * @param data
         * @return
         * @throws Exception
         */
        public PageResponse<InoutData> submitRegisterInout (InoutData data) throws Exception {
        if (null == data.getCompleteTime()) {
            return "请填写完成时间!!";
        }
        if (StringUtils.isEmpty(data.getDepotId())) {
            return "请填写仓库信息!";
        }
        if (StringUtils.isEmpty(data.getFoodYear())) {
            return "请填写粮食年份信息!";
        }
        if (StringUtils.isEmpty(data.getFoodVariety())) {
            return "请填写粮食品种信息!";
        }
        if (data.getSettleWeight() <= 0) {
            return "请填写结算净重信息!";
        }
        String msg = inoutService.quickComplete(data);
        if (null == msg) {
            data.setProgress(InoutConstant.PROGRESS_RECORD);
            commonService.initInoutDepotStore(data);
        }
        return msg;
    }
    public void initLpr(InoutConf conf) {
        inoutDeviceManager.initLpr(conf);
    }
    /**
     * 出入库注册数据提交,入库登记和出入库登记使用同一个方法
     *
     * @param data
     * @return
     * @throws Exception
     */
    public PageResponse<InoutData> submitRegisterInout(InoutData data) throws Exception {
        //首先判断流程中是否有已经存在的车辆信息未执行完成,直接从数据库中查询
        InoutParam param = new InoutParam();
        param.setCompanyId(data.getCompanyId());
        param.setPlateNum(data.getPlateNum());
        param.setIntelCard(data.getIntelCard());
        param.setType(data.getType());
        param.setStart(DateUtil.getNewByDay(null, -10));
        int num = inoutService.checkExist(param);
        if (num > 0) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "当前车牌或智慧卡有正在执行流程未结束,请联系管理员", data);
        }
        //获取系统参数配置
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
        if (null == inoutSysConf) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "提示:当前库区未配置出入库流程信息,请联系管理员", data);
        }
        //获取下一个流程状态
        String curProgress = data.getProgress();
        String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
        data = updateBasicInfo(data, curProgress, nextProgress);
        String msg = inoutService.insertData(data);
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    msg, data);
        }
        // 执行附件信息
        fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
    }
    public PageResponse<InoutData> submitWeightIn(InoutData data) throws Exception {
        //获取系统参数配置
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
        if (null == inoutSysConf) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "提示:当前系统中流程配置异常,请联系管理员", data);
        }
        //获取下一个流程状态
        String curProgress = data.getProgress();
        String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
        data = updateBasicInfo(data, curProgress, nextProgress);
        //入库称重可能调整质检单
        CheckUpdateResult checkUpdateResult = updateCheckItems(data);
        if (data.getDeCheck() == 0) {
            data.setDeCheck(checkUpdateResult.getDeSum());
        }
        if (data.getAddCheck() == 0) {
            data.setAddCheck(checkUpdateResult.getAddSum());
        }
        //执行数据更新
        String msg = inoutService.updateData(data);
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg, data);
        }
        // 执行附件信息
        fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
        //称重完成,调用出入库控制逻辑处理
        inoutDeviceManager.controlWeight(data, curProgress, nextProgress);
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
    }
    public PageResponse<InoutData> submitWeightOut(InoutData data) throws Exception {
        //获取系统参数配置
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
        if (null == inoutSysConf) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "提示:当前系统中流程配置异常,请联系管理员", data);
        }
        //获取下一个流程状态
        String curProgress = data.getProgress();
        String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
        data = updateBasicInfo(data, curProgress, nextProgress);
        //执行数据更新
        String msg = inoutService.updateData(data);
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg, data);
        }
        // 执行附件信息
        fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
        //称重后根据当前流程状态和下一个状态,通知称重控制器
        inoutDeviceManager.controlWeight(data, curProgress, nextProgress);
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
    }
    public PageResponse<InoutData> submitHandle(InoutData data) throws Exception {
        if (null == data.getHandleUser()) {
            data.setHandleUser(ContextUtil.getLoginUserCName());
        }
        //获取系统参数配置
        InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
        if (null == inoutSysConf) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "提示:当前系统中流程配置异常,请联系管理员", data);
        }
        //获取下一个流程状态
        String curProgress = data.getProgress();
        String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
        data = updateBasicInfo(data, curProgress, nextProgress);
        //执行数据更新
        String msg = inoutService.updateDataByHandle(data);
        if (null != msg) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg, data);
        }
        // 执行附件信息
        fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
        return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
    }
    /**
     * 根据条件获取扦样数据
     *
     * @param param
     * @return
     */
    public PageResponse<Page<InoutCheckData>> pageSampleData(InoutCheckParam param) {
        if (StringUtils.isEmpty(param.getCompanyId())) {
            param.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(param.getDeptId())) {
            param.setDeptId(ContextUtil.subDeptId(null));
        }
        //若查询条件为已扦样,则流程置空;若未扦样,则流程不处理,仍为扦样化验流程(CHECK)
        if (!"NONE".equals(param.getSampleStatus())) {
            param.setProgress(null);
        }
        //获取扦样数据
        Page<InoutCheckData> sampleList = inoutService.pageSampleData(param);
        if (null == sampleList.getRecords() || sampleList.getRecords().isEmpty()) {
            return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                    "获取到数据信息为空");
        }
        return new PageResponse<>(RespCodeEnum.CODE_0000, sampleList);
    }
    @Transactional(rollbackFor = Exception.class)
    public PageResponse<InoutCheckData> updateSampleData(InoutCheckData data) {
        try {
            // 获取业务数据信息
            //首先判断流程中是否有已经存在的车辆信息未执行完成,直接从数据库中查询
            InoutParam param = new InoutParam();
            param.setCompanyId(data.getCompanyId());
            param.setId(data.getId());
            InoutData curData = inoutService.inoutProgressQuery(param);
            if (null == curData) {
            param.setPlateNum(data.getPlateNum());
            param.setIntelCard(data.getIntelCard());
            param.setType(data.getType());
            param.setStart(DateUtil.getNewByDay(null, -10));
            int num = inoutService.checkExist(param);
            if (num > 0) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "没有获取到入库业务数据信息,更新失败", data);
            }
            if (InoutConstant.PROGRESS_RECORD.equals(curData.getProgress())) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "当前流程已经结束,不支持修改");
                        "当前车牌或智慧卡有正在执行流程未结束,请联系管理员", data);
            }
            //扦样时间和扦样人
            if (StringUtils.isEmpty(data.getSampleUser())) {
                data.setSampleUser(ContextUtil.getLoginUserCName());
            }
            if (null == data.getSampleTime()) {
                data.setSampleTime(new Date());
            }
            String msg = inoutService.updateSampleData(data);
            if (null != msg) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg);
            }
            return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功");
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage(), null);
        }
    }
    /**
     * @param param
     * @return
     */
    public PageResponse<Page<InoutCheckData>> pageCheckData(InoutCheckParam param) {
        if (StringUtils.isEmpty(param.getCompanyId())) {
            param.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(param.getDeptId())) {
            param.setDeptId(ContextUtil.subDeptId(null));
        }
        // 如果是已化验,则将流程状态置空,如果是未化验,则流程状态不处理,仍是CHECK状态
        if (!"NONE".equals(param.getCheckStatus())) {
            param.setProgress(null);
        }
        Page<InoutCheckData> checkList = inoutService.pageCheckData(param);
        if (null == checkList.getRecords() || checkList.getRecords().isEmpty()) {
            return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                    "获取到数据信息为空");
        }
        return new PageResponse<>(RespCodeEnum.CODE_0000, checkList);
    }
    /**
     * 获取化验项信息
     *
     * @param param
     * @return
     */
    public PageResponse<List<CheckItemData>> getCheckItemData(InoutCheckParam param) {
        try {
            List<CheckItemData> result = checkStandardManager.listCheckItem(param.getCheckId(),
                    param.getCompanyId(), param.getFoodVariety());
            return new PageResponse<>(RespCodeEnum.CODE_0000, result);
        } catch (Exception e) {
            return new PageResponse<>(
                    RespCodeEnum.CODE_1111.getCode(), "后台异常:" + e.getMessage(), null);
        }
    }
    @Transactional(rollbackFor = Exception.class)
    public PageResponse<InoutCheckData> updateCheckData(InoutCheckData data) {
        try {
            // 获取业务数据信息
            InoutParam param = new InoutParam();
            param.setCompanyId(data.getCompanyId());
            param.setId(data.getId());
            InoutData curData = inoutService.inoutProgressQuery(param);
            if (null == curData) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "没有获取到入库业务数据信息,更新失败", data);
            }
            if (InoutConstant.PROGRESS_RECORD.equals(curData.getProgress())) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "当前流程已经结束,不支持修改");
            }
            //更新化验项信息
            CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
            if (StringUtils.isNotEmpty(checkResult.getMsg())) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "后台执行异常:" + checkResult.getMsg(), data);
            }
            //设置化验信息
            if (checkResult.getDeSum() > 0) {
                data.setDeCheck(checkResult.getDeSum());
            }
            if (checkResult.getAddSum() > 0) {
                data.setAddCheck(checkResult.getAddSum());
            }
            if (null == data.getCheckTime()) {
                data.setCheckTime(new Date());
            }
            curData.setCheckStatus(data.getCheckStatus());
            //获取系统参数配置
            InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
@@ -1259,55 +752,344 @@
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "提示:当前库区未配置出入库流程信息,请联系管理员", data);
            }
            //更新下一流程状态
            if (InoutConstant.PROGRESS_CHECK.equals(curData.getProgress())) {
                curData = updateBasicInfo(curData, inoutSysConf);
                // 若化验结果不合格,判断配置后续流程
                if (InoutConstant.STATUS_UNPASS.equals(curData.getCheckStatus())) {
                    curData = checkNoPass(curData);
                }
            }
            //化验人、化验时间
            data.setCheckStatus(curData.getCheckStatus());
            data.setProgress(curData.getProgress());
            if (StringUtils.isEmpty(data.getCheckUser())) {
                data.setCheckUser(ContextUtil.getLoginUserCName());
            }
            if (null == data.getCheckTime()) {
                data.setCheckTime(new Date());
            }
            String msg = inoutService.updateCheckData(data);
            //获取下一个流程状态
            String curProgress = data.getProgress();
            String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
            data = updateBasicInfo(data, curProgress, nextProgress);
            String msg = inoutService.insertData(data);
            if (null != msg) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg);
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        msg, data);
            }
            return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功");
        } catch (Exception e) {
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage(), null);
            // 执行附件信息
            fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
            return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
        }
    }
    /**
     * 获取单价信息
     *
     * @param param
     * @return
     */
    public PageResponse<InoutPrice> getPrice(InoutCheckParam param) {
        try {
            List<InoutPrice> price = inoutService.getPrice(param);
            if (null == price || price.isEmpty()) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "未获取到粮食定价配置信息");
        public PageResponse<InoutData> submitWeightIn (InoutData data) throws Exception {
            //获取系统参数配置
            InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
            if (null == inoutSysConf) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "提示:当前系统中流程配置异常,请联系管理员", data);
            }
            return new PageResponse<>(RespCodeEnum.CODE_0000, price.get(0));
        } catch (Exception e) {
            return new PageResponse<>(
                    RespCodeEnum.CODE_1111.getCode(), "后台异常:" + e.getMessage(), null);
            //获取下一个流程状态
            String curProgress = data.getProgress();
            String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
            data = updateBasicInfo(data, curProgress, nextProgress);
            //入库称重可能调整质检单
            CheckUpdateResult checkUpdateResult = updateCheckItems(data);
            if (data.getDeCheck() == 0) {
                data.setDeCheck(checkUpdateResult.getDeSum());
            }
            if (data.getAddCheck() == 0) {
                data.setAddCheck(checkUpdateResult.getAddSum());
            }
            //执行数据更新
            String msg = inoutService.updateData(data);
            if (null != msg) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg, data);
            }
            // 执行附件信息
            fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
            //称重完成,调用出入库控制逻辑处理
            inoutDeviceManager.controlWeight(data, curProgress, nextProgress);
            return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
        }
    }
}
        public PageResponse<InoutData> submitWeightOut (InoutData data) throws Exception {
            //获取系统参数配置
            InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
            if (null == inoutSysConf) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "提示:当前系统中流程配置异常,请联系管理员", data);
            }
            //获取下一个流程状态
            String curProgress = data.getProgress();
            String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
            data = updateBasicInfo(data, curProgress, nextProgress);
            //执行数据更新
            String msg = inoutService.updateData(data);
            if (null != msg) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg, data);
            }
            // 执行附件信息
            fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
            //称重后根据当前流程状态和下一个状态,通知称重控制器
            inoutDeviceManager.controlWeight(data, curProgress, nextProgress);
            return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
        }
        public PageResponse<InoutData> submitHandle (InoutData data) throws Exception {
            if (null == data.getHandleUser()) {
                data.setHandleUser(ContextUtil.getLoginUserCName());
            }
            //获取系统参数配置
            InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
            if (null == inoutSysConf) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "提示:当前系统中流程配置异常,请联系管理员", data);
            }
            //获取下一个流程状态
            String curProgress = data.getProgress();
            String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf);
            data = updateBasicInfo(data, curProgress, nextProgress);
            //执行数据更新
            String msg = inoutService.updateDataByHandle(data);
            if (null != msg) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg, data);
            }
            // 执行附件信息
            fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress);
            return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data);
        }
        /**
         * 根据条件获取扦样数据
         *
         * @param param
         * @return
         */
        public PageResponse<Page<InoutCheckData>> pageSampleData (InoutCheckParam param){
            if (StringUtils.isEmpty(param.getCompanyId())) {
                param.setCompanyId(ContextUtil.getCompanyId());
            }
            if (StringUtils.isEmpty(param.getDeptId())) {
                param.setDeptId(ContextUtil.subDeptId(null));
            }
            //若查询条件为已扦样,则流程置空;若未扦样,则流程不处理,仍为扦样化验流程(CHECK)
            if (!"NONE".equals(param.getSampleStatus())) {
                param.setProgress(null);
            }
            //获取扦样数据
            Page<InoutCheckData> sampleList = inoutService.pageSampleData(param);
            if (null == sampleList.getRecords() || sampleList.getRecords().isEmpty()) {
                return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                        "获取到数据信息为空");
            }
            return new PageResponse<>(RespCodeEnum.CODE_0000, sampleList);
        }
        @Transactional(rollbackFor = Exception.class)
        public PageResponse<InoutCheckData> updateSampleData (InoutCheckData data){
            try {
                // 获取业务数据信息
                InoutParam param = new InoutParam();
                param.setCompanyId(data.getCompanyId());
                param.setId(data.getId());
                InoutData curData = inoutService.inoutProgressQuery(param);
                if (null == curData) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                            "没有获取到入库业务数据信息,更新失败", data);
                }
                if (InoutConstant.PROGRESS_RECORD.equals(curData.getProgress())) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                            "当前流程已经结束,不支持修改");
                }
                //扦样时间和扦样人
                if (StringUtils.isEmpty(data.getSampleUser())) {
                    data.setSampleUser(ContextUtil.getLoginUserCName());
                }
                if (null == data.getSampleTime()) {
                    data.setSampleTime(new Date());
                }
                String msg = inoutService.updateSampleData(data);
                if (null != msg) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg);
                }
                return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功");
            } catch (Exception e) {
                log.error("后台异常:{}", e);
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "后台异常:" + e.getMessage(), null);
            }
        }
        /**
         * @param param
         * @return
         */
        public PageResponse<Page<InoutCheckData>> pageCheckData (InoutCheckParam param){
            if (StringUtils.isEmpty(param.getCompanyId())) {
                param.setCompanyId(ContextUtil.getCompanyId());
            }
            if (StringUtils.isEmpty(param.getDeptId())) {
                param.setDeptId(ContextUtil.subDeptId(null));
            }
            // 如果是已化验,则将流程状态置空,如果是未化验,则流程状态不处理,仍是CHECK状态
            if (!"NONE".equals(param.getCheckStatus())) {
                param.setProgress(null);
            }
            Page<InoutCheckData> checkList = inoutService.pageCheckData(param);
            if (null == checkList.getRecords() || checkList.getRecords().isEmpty()) {
                return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                        "获取到数据信息为空");
            }
            return new PageResponse<>(RespCodeEnum.CODE_0000, checkList);
        }
        /**
         * 获取化验项信息
         *
         * @param param
         * @return
         */
        public PageResponse<List<CheckItemData>> getCheckItemData (InoutCheckParam param){
            try {
                List<CheckItemData> result = checkStandardManager.listCheckItem(param.getCheckId(),
                        param.getCompanyId(), param.getFoodVariety());
                return new PageResponse<>(RespCodeEnum.CODE_0000, result);
            } catch (Exception e) {
                return new PageResponse<>(
                        RespCodeEnum.CODE_1111.getCode(), "后台异常:" + e.getMessage(), null);
            }
        }
        @Transactional(rollbackFor = Exception.class)
        public PageResponse<InoutCheckData> updateCheckData (InoutCheckData data){
            try {
                // 获取业务数据信息
                InoutParam param = new InoutParam();
                param.setCompanyId(data.getCompanyId());
                param.setId(data.getId());
                InoutData curData = inoutService.inoutProgressQuery(param);
                if (null == curData) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                            "没有获取到入库业务数据信息,更新失败", data);
                }
                if (InoutConstant.PROGRESS_RECORD.equals(curData.getProgress())) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                            "当前流程已经结束,不支持修改");
                }
                //更新化验项信息
                CheckUpdateResult checkResult = checkStandardManager.updateCheckItems(data.getCheckId(), data.getCompanyId(), data.getCheckItems());
                if (StringUtils.isNotEmpty(checkResult.getMsg())) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                            "后台执行异常:" + checkResult.getMsg(), data);
                }
                //设置化验信息
                if (checkResult.getDeSum() > 0) {
                    data.setDeCheck(checkResult.getDeSum());
                }
                if (checkResult.getAddSum() > 0) {
                    data.setAddCheck(checkResult.getAddSum());
                }
                if (null == data.getCheckTime()) {
                    data.setCheckTime(new Date());
                }
                curData.setCheckStatus(data.getCheckStatus());
                //获取系统参数配置
                InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId());
                if (null == inoutSysConf) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                            "提示:当前库区未配置出入库流程信息,请联系管理员", data);
                }
                //更新下一流程状态
                if (InoutConstant.PROGRESS_CHECK.equals(curData.getProgress())) {
                    curData = updateBasicInfo(curData, inoutSysConf);
                    // 若化验结果不合格,判断配置后续流程
                    if (InoutConstant.STATUS_UNPASS.equals(curData.getCheckStatus())) {
                        curData = checkNoPass(curData);
                    }
                }
                //化验人、化验时间
                data.setCheckStatus(curData.getCheckStatus());
                data.setProgress(curData.getProgress());
                if (StringUtils.isEmpty(data.getCheckUser())) {
                    data.setCheckUser(ContextUtil.getLoginUserCName());
                }
                if (null == data.getCheckTime()) {
                    data.setCheckTime(new Date());
                }
                String msg = inoutService.updateCheckData(data);
                if (null != msg) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg);
                }
                return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功");
            } catch (Exception e) {
                return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                        "后台异常:" + e.getMessage(), null);
            }
        }
        /**
         * 获取单价信息
         *
         * @param param
         * @return
         */
        public PageResponse<InoutPrice> getPrice (InoutCheckParam param){
            try {
                List<InoutPrice> price = inoutService.getPrice(param);
                if (null == price || price.isEmpty()) {
                    return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "未获取到粮食定价配置信息");
                }
                return new PageResponse<>(RespCodeEnum.CODE_0000, price.get(0));
            } catch (Exception e) {
                return new PageResponse<>(
                        RespCodeEnum.CODE_1111.getCode(), "后台异常:" + e.getMessage(), null);
            }
        }
    }
igds-inout/src/main/java/com/ld/igds/inout/service/InoutService.java
@@ -1,6 +1,5 @@
package com.ld.igds.inout.service;
import com.ld.igds.check.dto.CheckItemData;
import com.ld.igds.data.Page;
import com.ld.igds.inout.dto.*;
import com.ld.igds.models.InoutPrice;
@@ -135,14 +134,6 @@
    /**
     * 根据数据进行推送
     *
     * @param result
     */
    void notifyWeb(InoutData result);
    /**
     * 推送大屏
     *
     * @param companyId
@@ -179,11 +170,10 @@
    /**
     * 获取当前仓库下最后一条记录信息
     *
     * @param companyId
     * @param depotId
     * @param param
     * @return
     */
    InoutData getLastRecord(String companyId, String depotId);
    InoutData getLastRecord(InoutParam param);
    /**
     * 根据损溢记录,添加出入库记录信息
@@ -206,15 +196,6 @@
     * @param data
     */
    void setCheckCache(InoutData data);
    /**
     * 根据组织编码和化验ID获取化验结果信息
     *
     * @param companyId
     * @param checkId
     * @return
     */
    List<CheckItemData> getCheckCache(String companyId, String checkId);
    /**
     * 获取出入库流水ID序号
@@ -277,9 +258,18 @@
    /**
     * 获取粮食定价
     *
     * @param param
     * @return
     */
    List<InoutPrice> getPrice(InoutCheckParam param);
    /**
     * 从缓存中删除
     *
     * @param deptId
     * @param type
     * @param id
     */
    void delFromCache(String deptId, String type, String id);
}
igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java
@@ -1,7 +1,6 @@
package com.ld.igds.inout.service.impl;
import com.bstek.dorado.data.entity.EntityUtils;
import com.ld.igds.check.dto.CheckItemData;
import com.ld.igds.common.CoreCommonService;
import com.ld.igds.constant.BizType;
import com.ld.igds.constant.Constant;
@@ -9,20 +8,18 @@
import com.ld.igds.data.CommonData;
import com.ld.igds.data.Page;
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.inout.dto.InoutData;
import com.ld.igds.inout.dto.InoutParam;
import com.ld.igds.inout.dto.InoutCheckData;
import com.ld.igds.inout.dto.InoutCheckParam;
import com.ld.igds.inout.dto.InoutData;
import com.ld.igds.inout.dto.InoutParam;
import com.ld.igds.inout.mapper.InoutCheckMapper;
import com.ld.igds.inout.mapper.InoutRecordMapper;
import com.ld.igds.inout.service.InoutService;
import com.ld.igds.io.constant.OrderRespEnum;
import com.ld.igds.models.Depot;
import com.ld.igds.models.InoutPrice;
import com.ld.igds.util.ContextUtil;
import com.ld.igds.util.DateUtil;
import com.ld.igds.util.RedisUtil;
import com.ld.igds.websocket.WebSocketPacket;
import com.ld.igds.websocket.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -103,7 +100,7 @@
        inoutMapper.deleteData(param);
        delInoutFromCache(param.getDeptId(), param.getType(), param.getId());
        delFromCache(param.getDeptId(), param.getType(), param.getId());
        return null;
    }
@@ -115,7 +112,7 @@
        }
        // 缓存中删除
        delInoutFromCache(param.getDeptId(), param.getType(), param.getId());
        delFromCache(param.getDeptId(), param.getType(), param.getId());
        param.setProgress(InoutConstant.PROGRESS_RECORD);
        param.setRecordStatus(InoutConstant.RECORD_STATUS_ERROR);
@@ -285,11 +282,11 @@
    public String toComplete(InoutParam param) throws Exception {
        if (null == param.getCompanyId()) {
            param.setCompanyId(ContextUtil.getCompanyId());
            param.setCompanyId(ContextUtil.getDefaultCompanyId());
        }
        // 清除缓存
        this.delInoutFromCache(param.getDeptId(), param.getType(), param.getId());
        this.delFromCache(param.getDeptId(), param.getType(), param.getId());
        inoutMapper.toComplete(param);
@@ -361,7 +358,7 @@
        if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) {
            delInoutFromCache(data.getDeptId(), data.getType(), data.getId());
            delFromCache(data.getDeptId(), data.getType(), data.getId());
            setCompleteInoutCache(data.getDeptId(), data);
@@ -373,7 +370,7 @@
    }
    public void delInoutFromCache(String deptId, String type, String id) {
    public void delFromCache(String deptId, String type, String id) {
        if (StringUtils.isEmpty(deptId)) {
            return;
        }
@@ -450,22 +447,6 @@
    }
    @Override
    public void notifyWeb(InoutData result) {
        // 如果当前为满车称重执行推送
        if (result.getType().equals(InoutConstant.TYPE_IN) && result.getProgress().equals(InoutConstant.PROGRESS_WEIGHT_FULL)) {
            WebSocketPacket packet = new WebSocketPacket();
            packet.setBizType(BizType.SCREEN_CHECK.getCode());
            packet.setCompanyId(result.getCompanyId());
            packet.setOrderResp(OrderRespEnum.MSG_SUCCESS.getCode());
            packet.setData(result);
            packet.setBizTag(InoutConstant.PROGRESS_WEIGHT_FULL);
            log.debug("----向化验大屏推送满车称重信息 ----{}", result.getPlateNum());
            WebSocketServer.sendByBizTag(packet);
        }
    }
    @Override
    public Page<InoutData> pageUnCompleteData(InoutParam param) {
        if (StringUtils.isEmpty(param.getCompanyId())) {
@@ -498,10 +479,7 @@
    }
    @Override
    public InoutData getLastRecord(String companyId, String depotId) {
        InoutParam param = new InoutParam();
        param.setCompanyId(companyId);
        param.setDepotId(depotId);
    public InoutData getLastRecord(InoutParam param) {
        return inoutMapper.getLastRecord(param);
    }
@@ -509,7 +487,7 @@
    public String addInoutDataByLossOver(InoutData data) {
        // 获取上一车的流水数据
        InoutData inoutData = this.getLastRecord(data.getCompanyId(), data.getDepotId());
    //    InoutData inoutData = this.getLastRecord(data.getCompanyId(), data.getDepotId());
//        // 设置流水的库存
//        if (InoutConstant.TYPE_IN.equals(inoutData.getType())) {
@@ -540,12 +518,6 @@
        redisUtil.set(cacheKey, data.getCheckItems(), 60 * 60 * 24 * 3);
    }
    @SuppressWarnings("unchecked")
    @Override
    public List<CheckItemData> getCheckCache(String companyId, String checkId) {
        String cacheKey = RedisConst.buildKey(companyId, checkId);
        return (List<CheckItemData>) redisUtil.get(cacheKey);
    }
    /**
     * 出入库流程ID创建 202001030001 202001030001
igds-inout/src/main/java/com/ld/igds/m/service/HLossOverService.java
@@ -4,6 +4,7 @@
import java.util.HashMap;
import java.util.Map;
import javax.transaction.Transactional;
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.inout.dto.InoutData;
import com.ld.igds.inout.dto.InoutParam;
@@ -76,7 +77,13 @@
        data.setUpdateTime(new Date());
        data.setUpdateUser(ContextUtil.getLoginUserCName());
        InoutData inoutData = inoutService.getLastRecord(ContextUtil.getCompanyId(), data.getDepotId());
        InoutParam param = new InoutParam();
        param.setCompanyId(ContextUtil.getCompanyId());
        param.setDepotId(data.getDepotId());
        param.setProgress(InoutConstant.PROGRESS_RECORD);
        InoutData inoutData = inoutService.getLastRecord(param);
        if (null != inoutData && null != inoutData.getCompleteTime() &&
                data.getSubmitTime().before(inoutData.getCompleteTime())) {
@@ -94,9 +101,9 @@
                //获取提交时间日期的01:00:00时间
                Date curDate = DateUtil.getCurZero(data.getSubmitTime());
                curDate = DateUtils.addHours(curDate,1);
                curDate = DateUtils.addHours(curDate, 1);
                //如果完成时间在curDate之前,则将完成时间设为当前天的01:00:00
                if(data.getSubmitTime().before(curDate)){
                if (data.getSubmitTime().before(curDate)) {
                    data.setSubmitTime(curDate);
                }
@@ -116,45 +123,45 @@
        }
    }
    private String addInoutDataByLossOver(InoutLossOver lossOver){
        if (null == lossOver.getSubmitTime()) {
            lossOver.setSubmitTime(new Date());
        }
        InoutData data = new InoutData();
        data.setRecordStatus(InoutConstant.RECORD_STATUS_ADD);
        data.setProgress(InoutConstant.PROGRESS_RECORD);
        data.setType(lossOver.getType());
        data.setSettleWeight(lossOver.getAmount());
        data.setDepotId(lossOver.getDepotId());
        data.setDeptId(lossOver.getDeptId());
        data.setCompanyId(lossOver.getCompanyId());
        //data.setFoodVariety(lossOver.getFoodVariety());
        data.setCheckStatus(InoutConstant.STATUS_PASS);
    private String addInoutDataByLossOver(InoutLossOver lossOver) {
        if (null == lossOver.getSubmitTime()) {
            lossOver.setSubmitTime(new Date());
        }
        String loginUser = lossOver.getUpdateUser();
        data.setRegisterUser(loginUser);
        data.setFullWeightUser(loginUser);
        data.setEmptyWeightUser(loginUser);
        data.setHandleUser(loginUser);
        data.setCompleteUser(loginUser);
        data.setCompleteTime(lossOver.getSubmitTime());
        data.setRegisterTime(data.getCompleteTime());
        data.setFullWeightTime(data.getCompleteTime());
        data.setEmptyWeightTime(data.getCompleteTime());
        if (StringUtils.isEmpty(data.getUserId())) {
            data.setUserId(InoutConstant.DEFAULT_ID_CARD);
        }
        return inoutService.addInoutDataByLossOver(data);
    }
        InoutData data = new InoutData();
        data.setRecordStatus(InoutConstant.RECORD_STATUS_ADD);
        data.setProgress(InoutConstant.PROGRESS_RECORD);
        data.setType(lossOver.getType());
        data.setSettleWeight(lossOver.getAmount());
        data.setDepotId(lossOver.getDepotId());
        data.setDeptId(lossOver.getDeptId());
        data.setCompanyId(lossOver.getCompanyId());
        //data.setFoodVariety(lossOver.getFoodVariety());
        data.setCheckStatus(InoutConstant.STATUS_PASS);
    @Transactional(rollbackOn = Exception.class)
        String loginUser = lossOver.getUpdateUser();
        data.setRegisterUser(loginUser);
        data.setFullWeightUser(loginUser);
        data.setEmptyWeightUser(loginUser);
        data.setHandleUser(loginUser);
        data.setCompleteUser(loginUser);
        data.setCompleteTime(lossOver.getSubmitTime());
        data.setRegisterTime(data.getCompleteTime());
        data.setFullWeightTime(data.getCompleteTime());
        data.setEmptyWeightTime(data.getCompleteTime());
        if (StringUtils.isEmpty(data.getUserId())) {
            data.setUserId(InoutConstant.DEFAULT_ID_CARD);
        }
        return inoutService.addInoutDataByLossOver(data);
    }
    @Transactional(rollbackOn = Exception.class)
    public String delData(InoutLossOver data) throws Exception {
        Session session = this.getSessionFactory().openSession();
        try {
            if (null != data.getId()) {
                this.delInoutDataByLossOver(data);
                this.delInoutDataByLossOver(data);
                session.delete(data);
            }
        } catch (Exception e) {
@@ -166,19 +173,19 @@
        return null;
    }
    private void delInoutDataByLossOver(InoutLossOver lossOver) {
        InoutParam param = new InoutParam();
        param.setCompanyId(lossOver.getCompanyId());
        param.setId(lossOver.getId());
        param.setProgress(InoutConstant.PROGRESS_RECORD);
        param.setRecordStatus(InoutConstant.RECORD_STATUS_DEL);
        param.setMsg(" [" + ContextUtil.getLoginUserCName() + "]执行删除");
        param.setType(lossOver.getType());
        param.setDepotId(lossOver.getDepotId());
        param.setWeight(lossOver.getAmount());
        inoutService.delInoutDataByLossOver(param);
    }
    private void delInoutDataByLossOver(InoutLossOver lossOver) {
        InoutParam param = new InoutParam();
        param.setCompanyId(lossOver.getCompanyId());
        param.setId(lossOver.getId());
        param.setProgress(InoutConstant.PROGRESS_RECORD);
        param.setRecordStatus(InoutConstant.RECORD_STATUS_DEL);
        param.setMsg(" [" + ContextUtil.getLoginUserCName() + "]执行删除");
        param.setType(lossOver.getType());
        param.setDepotId(lossOver.getDepotId());
        param.setWeight(lossOver.getAmount());
        inoutService.delInoutDataByLossOver(param);
    }
}
igds-inout/src/main/resources/mapper/InoutRecordMapper.xml
@@ -143,12 +143,19 @@
        <where>
            <if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
            <if test="param.depotId != null and param.depotId != '' ">AND DEPOT_ID_ = #{param.depotId}</if>
            <if test="param.type != null and param.type != '' ">AND TYPE_ = #{param.type}</if>
            <if test="param.plateNum != null and param.plateNum != '' ">AND PLATE_NUM_ = #{param.plateNum}</if>
            <if test="param.intelCard != null and param.intelCard != '' ">AND INTEL_CARD_ = #{param.intelCard}</if>
            <if test="param.id != null and param.id != '' ">AND ID_ = #{param.id}</if>
            <if test="param.userId != null and param.userId != '' ">AND USER_ID_ = #{param.userId}</if>
            <if test="param.progress != null and param.progress != '' ">AND PROGRESS_ = #{param.progress}</if>
            <if test="param.start != null">AND
                REGISTER_TIME_ <![CDATA[ > ]]>#{param.start,jdbcType=TIMESTAMP}
            </if>
            <if test="param.end != null">AND
                COMPLETE_TIME_ <![CDATA[ < ]]>#{param.end,jdbcType=TIMESTAMP}
            </if>
            <if test="param.curStorage > 0">AND CUR_STORAGE_ > 0</if>
        </where>
        AND PROGRESS_ = 'RECORD'
        AND RECORD_STATUS_ != 'ERROR'
        AND RECORD_STATUS_ != 'DEL'
        ORDER BY COMPLETE_TIME_ DESC
@@ -463,20 +470,8 @@
        update D_INOUT_RECORD
        set PROGRESS_ = #{param.progress},
        COMPLETE_TIME_ =#{param.completeTime},
        <if test="param.fullWeight != null and param.fullWeight > 0">FULL_WEIGHT_ = #{param.fullWeight},</if>
        <if test="param.fullWeightUser != null">FULL_WEIGHT_USER_ = #{param.fullWeightUser},</if>
        <if test="param.fullWeightTime != null">FULL_WEIGHT_TIME_ = #{param.fullWeightTime},</if>
        <if test="param.emptyWeight != null and param.fullWeight > 0">EMPTY_WEIGHT_ = #{param.emptyWeight},</if>
        <if test="param.emptyWeightTime != null">EMPTY_WEIGHT_TIME_ = #{param.emptyWeightTime},</if>
        <if test="param.emptyWeightUser != null">EMPTY_WEIGHT_USER_ = #{param.emptyWeightUser},</if>
        <if test="param.netWeight != null and param.fullWeight > 0">NET_WEIGHT_ = #{param.netWeight},</if>
        <if test="param.settleWeight != null and param.settleWeight > 0">SETTLE_WEIGHT_ = #{param.settleWeight},</if>
        <if test="param.recordWeight != null and param.recordWeight > 0">RECORD_WEIGHT_ = #{param.recordWeight},</if>
        <if test="param.de != null and param.de > 0">DE_SUM_ = #{param.de},</if>
        <if test="param.depotId != null and param.depotId != ''">DEPOT_ID_ = #{param.depotId},</if>
        <if test="param.price != null and param.price > 0">PRICE_ = #{param.price},</if>
        <if test="param.settleMoney != null and param.settleMoney > 0">SETTLE_MONEY_ = #{param.settleMoney},</if>
        COMPLETE_USER_ = #{param.userId}
        COMPLETE_USER_ = #{param.userId},
        UPDATE_TIME_ = sysdate
        where ID_ = #{param.id}
        and TYPE_ = #{param.type}
        and COMPANY_ID_ = #{param.companyId}
igds-web/src/main/resources/static/admin/inout/in-card-back.js
@@ -16,36 +16,10 @@
    showProgress();
});
//控制流程环节显示
function showProgress() {
    if(!inoutProgress){
        return;
    }
    if(inoutProgress.indexOf("REGISTER") == -1){
        $("#progress-register").css("display", "none");
    }
    if(inoutProgress.indexOf("CHECK") == -1){
        $("#progress-check").css("display", "none");
    }
    if(inoutProgress.indexOf("WEIGHT_FULL") == -1){
        $("#progress-fullWeight").css("display", "none");
    }
    if(inoutProgress.indexOf("HANDLE") == -1){
        $("#progress-hand").css("display", "none");
    }
    if(inoutProgress.indexOf("WEIGHT_EMPTY") == -1){
        $("#progress-emptyWeight").css("display", "none");
    }
    if(inoutProgress.indexOf("CARD_BACK") == -1){
        $("#progress-cardBack").css("display", "none");
    }
}
//新的读卡方式
//使用插件读取智慧卡号
function flushICCard() {
    var index = layer.load();
    $("#intelCard").val(null);
    resetForm();
    $.ajax({
        type: "GET",
        async: true,
@@ -55,23 +29,26 @@
        jsonp: "callback",
        jsonpCallback: "jsonpCallback",
        success: function (json) {
            //console.log(json);
            layer.close(index);
            var data = json.no;
            //console.log(data);
            if (data === "not found") {
                layer.alert("请重新读卡!", {offset: ['300px', '300px']});
                alertError("请重新读卡!");
            } else {
                $("#intelCard").val(data);
                //直接刷新数据
                flushData();
            }
        },
        error: function () {
            layer.alert("IC卡读取出错!", {offset: ['300px', '300px']});
            layer.close(index);
            alertError("IC卡读取出错!");
        }
    });
}
// 使用插件获取省份证
//使用插件读取身份证
function flushIdCard() {
    var index = layer.load();
    $.ajax({
@@ -86,64 +63,17 @@
            layer.close(index);
            var data = json.content;
            if (data === "not found") {
                layer.alert("没有读取到身份证信息,请手动录入!", {
                    offset: ['300px', '300px']
                });
                alertError("没有获取到身份证信息!");
                return;
            }
            $("#userId").val(data.idNum);
            flushData();
        },
        error: function () {
            layer.alert("身份证读取失败,请手动录入!", {
                offset: ['300px', '300px']
            });
            layer.close(index);
            alertError("身份证读取失败!");
        }
    });
}
// 打印过磅单
function printBill() {
    if (!recordData) {
        layer.alert("没有获取到业务数据,不支持打印!");
        return;
    }
    if(InoutProgress.CARD_BACK != recordData.progress){
        layer.alert("当前数据不完整,不支持打印!");
        return;
    }
    //从后台获取模版并打印
    var index = layer.load();
    $.ajax({
        type : "POST",
        url : "../../basic/inout-report/inout-bill-weight",
        dataType : "json",
        contentType : "application/json;charset=UTF-8",
        data : JSON.stringify(recordData),
        success : function(result) {
            if (result.code != "0000") {
                layer.msg(result.msg);
            } else {
                layer.msg("开始渲染打印单……");
                printWeight(result.data);
            }
            layer.close(index);
        },
        error : function() {
            layer.close(index);
            layer.msg("获取打印模版失败,请联系管理员查看原因!!");
        }
    });
}
// 打印抽样单
function showCheck() {
    if (null == recordData) {
        layer.alert("没有获取到业务数据,无法查看!");
    }
}
// 表单清空
@@ -162,6 +92,7 @@
    var plateNum = $("#plateNum").val();
    var userId2 = $("#userId").val();
    var intelCard = $("#intelCard").val();
    var param = {
        type : type,
        progress : progress,
@@ -190,7 +121,7 @@
        },
        error : function() {
            layer.close(index);
            layer.alert("查询失败,请重新尝试!!");
            alertError("查询失败,请重新尝试!")
        }
    });
}
@@ -198,7 +129,7 @@
// 当前完成
function submit() {
    if (!recordData) {
        layer.alert("没有数据可以提交!!!");
        alertError("没有数据可以提交!");
        return;
    }
igds-web/src/main/resources/static/img/areation/default/pfc2_a.png

igds-web/src/main/resources/static/img/areation/default/pfc2_b.png

igds-web/src/main/resources/static/img/areation/default/pfc_a.png

igds-web/src/main/resources/static/img/areation/default/pfc_b.png

igds-web/src/main/resources/templates/admin/inout/in-card-back.html
@@ -39,17 +39,9 @@
        <div class="qyzj-btnbox layui-clear">
            <div class="rkbk-quick fl">
                <button class="rkbk-quick-btn layui-btn" onclick="showCheck()">
                    <i><img th:src="@{../../static/images/icon-hyd.png}"/></i> 查看化验单
                </button>
                <button class="rkbk-quick-btn layui-btn btn-green"
                        onclick="submit()">
                    <i><img th:src="@{../../static/images/icon-ok.png}"/></i> 收卡出库
                </button>
                <button class="rkbk-quick-btn layui-btn btn-violet"
                        onclick="printBill()">
                    <i><img th:src="@{../../static/images/icon-dayin.png}"/></i>
                    打印过磅单
                </button>
            </div>
@@ -188,7 +180,7 @@
                            <div class="rkbk-quick layui-text-center">
                                <button id="button_readID" type="button"
                                        onclick="flushIdCard()"
                                        class="rkbk-quick-btn layui-btn btn-blue">读取身份证
                                        class="rkbk-quick-btn layui-btn btn-blue">读身份证查询
                                </button>
                            </div>
                            <!--rkbk-form-box2 end-->
@@ -211,33 +203,35 @@
                    <div class="rkbk-left-form rkbk-right-form">
                        <form class="layui-form" action="" id="form-data"
                              lay-filter="form-data">
                            <div class="layui-form-item display-none">
                                <label class="layui-form-label">隐藏字段-ID</label>
                                    <input type="text" name="id">
                            </div>
                            <div class="layui-form-item display-none">
                                <label class="layui-form-label">隐藏字段-流程节点</label>
                                <input type="text" name="progress">
                            </div>
                            <div class="layui-form-item display-none">
                                <label class="layui-form-label">隐藏字段-业务类型</label>
                                <input type="text" name="type">
                            </div>
                            <div class="layui-form-item display-none">
                                <input type="text" name="deptId">
                            </div>
                            <div class="layui-form-item display-none">
                                <input type="text" name="noticeId">
                            </div>
                            <div class="layui-form-item">
                                <input type="button" value="读卡" class="rkbk-r-btn fr layui-btn" onclick="flushICCard()">
                                <input type="button" value="读卡查询" class="rkbk-r-btn fr layui-btn" onclick="flushICCard()">
                                <label class="layui-form-label">智慧卡号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="intelCard" id="intelCard"
                                           placeholder="先点击读卡,后放卡......" autocomplete="off"
                                           placeholder="读卡获取" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <input type="button" value="查询" class="rkbk-r-btn fr layui-btn" onclick="flushData()">
                                <input type="button" value="车牌查询" class="rkbk-r-btn fr layui-btn" onclick="flushData()">
                                <label class="layui-form-label">车牌号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="plateNum" id="plateNum"
@@ -258,23 +252,27 @@
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">粮食品种</label>
                                <label class="layui-form-label">出入库类型</label>
                                <div class="layui-input-block">
                                    <select name="foodVariety" disabled>
                                        <option value="">自动获取</option>
                                        <option th:each="dic,dicSet:${listFoodVariety}"
                                                th:value="${dic.code}" th:text="${dic.name}"></option>
                                    <select name="type" disabled>
                                        <option value="IN">入库作业</option>
                                        <option value="OUT">出库作业</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">粮食等级</label>
                                <label class="layui-form-label">流程进度</label>
                                <div class="layui-input-block">
                                    <select name="foodLevel" disabled>
                                        <option value="">自动获取</option>
                                        <option th:each="dic,dicSet:${listFoodLevel}"
                                                th:value="${dic.code}" th:text="${dic.name}"></option>
                                    <select name="progress" disabled>
                                        <option value="REGISTER">登记环节</option>
                                        <option value="CHECK">质检环节</option>
                                        <option value="HANDLE">值仓环节</option>
                                        <option value="WEIGHT_TAG">称重环节</option>
                                        <option value="WEIGHT_FULL">称重环节</option>
                                        <option value="WEIGHT_EMPTY">称重环节</option>
                                        <option value="CARD_BACK">离库确认</option>
                                        <option value="RECORD">流程完成</option>
                                    </select>
                                </div>
                            </div>
@@ -293,6 +291,15 @@
                                           autocomplete="off" class="layui-input rkbk-search-input" disabled>
                                </div>
                            </div>
                            <div class="rkbk-quick layui-text-center">
                                <button class="rkbk-quick-btn layui-btn btn-green"
                                        onclick="submit()">
                                    <i><img th:src="@{../../static/images/icon-ok.png}"/></i> 收卡出库
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
@@ -322,9 +329,6 @@
    var companyId = [[${loginUser.companyId}]];
    //出入库类型
    var type = [[${type}]];
    //品种
    var listFoodVariety = [[${listFoodVariety}]];
    var listFoodLevel = [[${listFoodLevel}]];
</script>
@@ -332,7 +336,7 @@
<script th:src="@{../../static/js/jquery.min.js}"></script>
<script th:src="@{../../static/js/constant.js}"></script>
<script th:src="@{../../static/js/igds-common.js}"></script>
<script th:src="@{../../static/admin/inout/inout-print.js}"></script>
<script th:src="@{../../static/admin/inout/inout-common.js}"></script>
<script th:src="@{../../static/admin/inout/in-card-back.js}"></script>
<!-- 弹出框的信息 -->
igds-web/src/main/resources/verb-conf.properties
@@ -134,12 +134,16 @@
verb.mapImg.5307_001.a=default_qyc_a.png
verb.mapImg.5307_001.b=default_qyc_b.png
## 5000_001
verb.mapImg.5000_001.a=default_pfc_a.png
verb.mapImg.5000_001.b=default_pfc_b.png
verb.mapImg.5000_001.a=default_pfc2_a.png
verb.mapImg.5000_001.b=default_pfc2_b.png
verb.mapImg.5000_0137.a=default_qyc_a.png
verb.mapImg.5000_0137.b=default_qyc_b.png
verb.mapImg.5000_0138.a=default_qyc_a.png
verb.mapImg.5000_0138.b=default_qyc_b.png
## 5322_001 广东徐闻
verb.mapImg.5322_001.a=default_pfc_a.png
verb.mapImg.5322_001.b=default_pfc_b.png