package com.ld.igds.inout.controller;
|
|
import com.bstek.bdf2.core.business.IUser;
|
import com.ld.igds.check.dto.CheckItemData;
|
import com.ld.igds.common.manager.CommonManager;
|
import com.ld.igds.constant.BizType;
|
import com.ld.igds.constant.Constant;
|
import com.ld.igds.constant.RespCodeEnum;
|
import com.ld.igds.data.BaseParam;
|
import com.ld.igds.data.Page;
|
import com.ld.igds.data.PageResponse;
|
import com.ld.igds.inout.InoutConstant;
|
import com.ld.igds.inout.dto.InoutData;
|
import com.ld.igds.inout.dto.InoutGateDto;
|
import com.ld.igds.inout.dto.InoutParam;
|
import com.ld.igds.inout.manager.InoutCommonManager;
|
import com.ld.igds.inout.manager.InoutManager;
|
import com.ld.igds.io.dto.WeightDto;
|
import com.ld.igds.models.Depot;
|
import com.ld.igds.models.DicTrigger;
|
import com.ld.igds.models.InoutConf;
|
import com.ld.igds.util.ContextUtil;
|
import com.ld.igds.util.DateUtil;
|
import lombok.extern.slf4j.Slf4j;
|
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.servlet.ModelAndView;
|
|
import javax.annotation.Resource;
|
import javax.servlet.http.HttpServletRequest;
|
import java.util.Date;
|
import java.util.List;
|
|
|
/**
|
* @Desc: 出入库业务流程控制层,主要为标准卡车出入库流程控制管理
|
* @author: Andy
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("basic/inout")
|
public class InoutController {
|
|
@Resource
|
private CommonManager commonManager;
|
@Resource
|
private InoutManager inoutManager;
|
@Resource
|
private InoutCommonManager inoutCommonManager;
|
|
/**
|
* 入库登记
|
*
|
* @param sort 表示使用的出入库设备配套号,不传递默认为1
|
* @return
|
*/
|
@RequestMapping("/in-register")
|
public ModelAndView inRegister(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
|
ModelAndView view = new ModelAndView();
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
|
if (StringUtils.isEmpty(sort)) {
|
sort = commonManager.getInoutWeightByClient(httpRequest);
|
}
|
|
if (StringUtils.isEmpty(sort)) {
|
sort = "1";
|
}
|
|
String deptId = ContextUtil.subDeptId(user);
|
view.addObject("bizType", BizType.INOUT_IN.getCode());
|
view.addObject("type", InoutConstant.TYPE_IN);
|
view.addObject("deptId", deptId);
|
|
//入库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), ContextUtil.subDeptId(user), InoutConstant.TYPE_IN);
|
view.addObject("inoutProgress", inoutProgress);
|
// 当前流程节点
|
view.addObject("progress", InoutConstant.PROGRESS_REGISTER);
|
|
// 获取出入库配置信息
|
List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
|
|
// 车牌识别参数封装
|
InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_10, InoutConstant.PROGRESS_REGISTER, 1);
|
view.addObject("lprDto", conf);
|
|
//初始化车牌识别
|
inoutManager.initLpr(conf);
|
|
view.setViewName("admin/inout/in-register");
|
return view;
|
}
|
|
/**
|
* 扦样化验页面
|
*
|
* @param sort 表示使用的出入库设备配套号,不传递默认为1
|
* @return
|
*/
|
@RequestMapping("/in-check")
|
public ModelAndView inCheck(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
|
if (StringUtils.isEmpty(sort)) {
|
sort = commonManager.getInoutWeightByClient(httpRequest);
|
}
|
ModelAndView view = new ModelAndView();
|
// 仓库列表做下拉框使用
|
List<Depot> listDepot = commonManager.listDepot(true);
|
view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
String deptId = ContextUtil.subDeptId(user);
|
|
view.addObject("bizType", BizType.INOUT_IN.getCode());
|
view.addObject("type", InoutConstant.TYPE_IN);
|
view.addObject("deptId", deptId);
|
|
//入库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN);
|
view.addObject("inoutProgress", inoutProgress);
|
|
// 当前流程节点
|
view.addObject("progress", InoutConstant.PROGRESS_CHECK);
|
|
// 粮食品种下拉框
|
List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
|
view.addObject("listFoodVariety", listFoodVariety);
|
|
// 粮食等级下拉框
|
List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
|
view.addObject("listFoodLevel", listFoodLevel);
|
|
view.addObject("endTime",
|
DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
|
view.addObject("startTime", DateFormatUtils.format(
|
DateUtil.getNewByDay(null, -30), "yyyy-MM-dd"));
|
|
// 获取出入库配置信息
|
List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
|
|
// 获取扦样机信息
|
InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_20, InoutConstant.PROGRESS_CHECK, 1);
|
view.addObject("checkDto", conf);
|
view.setViewName("admin/inout/in-check");
|
return view;
|
}
|
|
/**
|
* 入库称重操作,包括空车称重和满车称重,共用一个页面
|
*
|
* @param sort 表示使用的出入库设备配套号,不传递默认为1
|
* @return
|
*/
|
@RequestMapping("/in-weight")
|
public ModelAndView inWeight(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
|
|
//如果没有指定地磅,从用户上一个选择中获取
|
if (StringUtils.isEmpty(sort)) {
|
sort = commonManager.getInoutWeightByClient(httpRequest);
|
}
|
|
ModelAndView view = new ModelAndView();
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
String deptId = ContextUtil.subDeptId(user);
|
view.addObject("bizType", BizType.INOUT_IN.getCode());
|
view.addObject("type", InoutConstant.TYPE_IN);
|
view.addObject("deptId", deptId);
|
|
// 仓库列表做下拉框使用
|
List<Depot> listDepot = commonManager.listInDepot();
|
view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
|
|
// 当前流程标签
|
view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG);
|
|
//入库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN);
|
view.addObject("inoutProgress", inoutProgress);
|
|
//称重结果是否可修改
|
String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), ContextUtil.subDeptId(user));
|
view.addObject("weightEditTag", weightEditTag);
|
|
// 粮食品种下拉框
|
List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
|
view.addObject("listFoodVariety", listFoodVariety);
|
|
// 获取出入库配置信息
|
List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
|
|
//获取所有的地磅列表用于页面用户选择
|
List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30);
|
view.addObject("listWeight", listWeight);
|
|
// 获取当前地磅信息
|
WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort);
|
view.addObject("weightDto", weightDto);
|
|
// 过程摄像头1
|
InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
|
InoutConstant.PROGRESS_WEIGHT_TAG, 1);
|
view.addObject("snapDto1", conf);
|
|
// 过程摄像头2
|
conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
|
InoutConstant.PROGRESS_WEIGHT_TAG, 2);
|
view.addObject("snapDto2", conf);
|
|
// 过程摄像头3
|
conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
|
InoutConstant.PROGRESS_WEIGHT_TAG, 3);
|
view.addObject("snapDto3", conf);
|
|
conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_70,
|
InoutConstant.PROGRESS_WEIGHT_TAG, 1);
|
|
view.addObject("gateDto", conf);
|
// 智慧卡
|
conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_80, InoutConstant.PROGRESS_WEIGHT_TAG, 1);
|
if(null != conf) conf.setSort(sort);
|
|
view.addObject("cardDto", conf);
|
|
view.setViewName("admin/inout/in-weight");
|
return view;
|
}
|
|
/**
|
* 入库-值仓
|
*
|
* @return
|
*/
|
@RequestMapping("/in-handle")
|
public ModelAndView inHandle() {
|
|
ModelAndView view = new ModelAndView();
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
view.addObject("bizType", BizType.INOUT_IN.getCode());
|
view.addObject("deptId", ContextUtil.subDeptId(user));
|
view.addObject("type", InoutConstant.TYPE_IN);
|
|
// 仓库列表做下拉框使用
|
List<Depot> listDepot = commonManager.listInDepot();
|
view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
|
|
//入库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
|
ContextUtil.subDeptId(user), InoutConstant.TYPE_IN);
|
view.addObject("inoutProgress", inoutProgress);
|
|
// 当前流程节点
|
view.addObject("progress", InoutConstant.PROGRESS_HANDLE);
|
|
// 粮食品种下拉框
|
List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
|
view.addObject("listFoodVariety", listFoodVariety);
|
|
// 粮食等级下拉框
|
List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
|
view.addObject("listFoodLevel", listFoodLevel);
|
|
view.setViewName("admin/inout/in-handle");
|
return view;
|
}
|
|
/**
|
* 入库-卡回收
|
*
|
* @return
|
*/
|
@RequestMapping("/in-card-back")
|
public ModelAndView inCardBack() {
|
ModelAndView view = new ModelAndView();
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
view.addObject("bizType", BizType.INOUT_IN.getCode());
|
view.addObject("deptId", ContextUtil.subDeptId(user));
|
view.addObject("type", InoutConstant.TYPE_IN);
|
|
// 仓库列表做下拉框使用
|
List<Depot> listDepot = commonManager.listInDepot();
|
view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
|
|
//入库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
|
ContextUtil.subDeptId(user), InoutConstant.TYPE_IN);
|
view.addObject("inoutProgress", inoutProgress);
|
|
// 当前流程节点
|
view.addObject("progress", InoutConstant.PROGRESS_CARD_BACK);
|
|
// 粮食品种下拉框
|
List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
|
view.addObject("listFoodVariety", listFoodVariety);
|
|
// 粮食等级下拉框
|
List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
|
view.addObject("listFoodLevel", listFoodLevel);
|
|
view.setViewName("admin/inout/in-card-back");
|
return view;
|
}
|
|
/**
|
* 出库登记
|
*
|
* @param sort 表示使用的出入库设备配套号,不传递默认为1
|
* @return
|
*/
|
@RequestMapping("/out-register")
|
public ModelAndView outRegister(@RequestParam(value = "sort", required = false) String sort) {
|
ModelAndView view = new ModelAndView();
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
String deptId = ContextUtil.subDeptId(user);
|
view.addObject("bizType", BizType.INOUT_OUT.getCode());
|
view.addObject("type", InoutConstant.TYPE_OUT);
|
view.addObject("deptId", deptId);
|
|
//入库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), ContextUtil.subDeptId(user), InoutConstant.TYPE_OUT);
|
view.addObject("inoutProgress", inoutProgress);
|
// 当前流程节点
|
view.addObject("progress", InoutConstant.PROGRESS_REGISTER);
|
|
// 获取出入库配置信息
|
List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
|
|
// 车牌识别参数封装
|
InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_10, InoutConstant.PROGRESS_REGISTER, 1);
|
view.addObject("lprDto", conf);
|
|
//初始化车牌识别
|
inoutManager.initLpr(conf);
|
|
view.setViewName("admin/inout/out-register");
|
return view;
|
}
|
|
/**
|
* 出库称重,包括空车称重和满车称重,共用一个页面
|
*
|
* @param sort 表示使用的出入库设备配套号,不传递默认为1
|
* @return
|
*/
|
@RequestMapping("/out-weight")
|
public ModelAndView outWeight(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
|
|
//如果没有指定地磅,从用户上一个选择中获取
|
if (StringUtils.isEmpty(sort)) {
|
sort = commonManager.getInoutWeightByClient(httpRequest);
|
}
|
|
ModelAndView view = new ModelAndView();
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
String deptId = ContextUtil.subDeptId(user);
|
view.addObject("bizType", BizType.INOUT_OUT.getCode());
|
view.addObject("type", InoutConstant.TYPE_OUT);
|
view.addObject("deptId", deptId);
|
|
// 仓库列表做下拉框使用
|
List<Depot> listDepot = commonManager.listInDepot();
|
view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
|
|
// 当前流程标签
|
view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG);
|
|
//入库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_OUT);
|
view.addObject("inoutProgress", inoutProgress);
|
|
//称重结果是否可修改
|
String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), ContextUtil.subDeptId(user));
|
view.addObject("weightEditTag", weightEditTag);
|
|
// 粮食品种下拉框
|
List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
|
view.addObject("listFoodVariety", listFoodVariety);
|
|
// 获取出入库配置信息
|
List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
|
|
//获取所有的地磅列表用于页面用户选择
|
List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30);
|
view.addObject("listWeight", listWeight);
|
|
// 获取当前地磅信息
|
WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort);
|
view.addObject("weightDto", weightDto);
|
|
// 过程摄像头1
|
InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
|
InoutConstant.PROGRESS_WEIGHT_TAG, 1);
|
view.addObject("snapDto1", conf);
|
|
// 过程摄像头2
|
conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
|
InoutConstant.PROGRESS_WEIGHT_TAG, 2);
|
view.addObject("snapDto2", conf);
|
|
// 过程摄像头3
|
conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
|
InoutConstant.PROGRESS_WEIGHT_TAG, 3);
|
view.addObject("snapDto3", conf);
|
|
view.setViewName("admin/inout/out-weight");
|
return view;
|
}
|
|
/**
|
* 出库-值仓
|
*
|
* @return
|
*/
|
@RequestMapping("/out-handle")
|
public ModelAndView outHandle() {
|
|
ModelAndView view = new ModelAndView();
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
|
String deptId = ContextUtil.subDeptId(user);
|
view.addObject("bizType", BizType.INOUT_OUT.getCode());
|
view.addObject("deptId", deptId);
|
view.addObject("type", InoutConstant.TYPE_OUT);
|
|
// 仓库列表做下拉框使用
|
List<Depot> listDepot = commonManager.listOutDepot();
|
view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
|
|
//出库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
|
ContextUtil.subDeptId(user), InoutConstant.TYPE_OUT);
|
view.addObject("inoutProgress", inoutProgress);
|
|
// 当前流程节点
|
view.addObject("progress", InoutConstant.PROGRESS_HANDLE);
|
|
// 粮食品种下拉框
|
List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
|
view.addObject("listFoodVariety", listFoodVariety);
|
|
// 粮食等级下拉框
|
List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
|
view.addObject("listFoodLevel", listFoodLevel);
|
|
view.setViewName("admin/inout/out-handle");
|
return view;
|
}
|
|
/**
|
* 出库-卡回收
|
*
|
* @return
|
*/
|
@RequestMapping("/out-card-back")
|
public ModelAndView outCardBack() {
|
|
ModelAndView view = new ModelAndView();
|
|
// 仓库列表做下拉框使用
|
List<Depot> listDepot = commonManager.listOutDepot();
|
view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
|
|
IUser user = ContextUtil.getLoginUser();
|
view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
|
view.addObject("bizType", BizType.INOUT_OUT.getCode());
|
view.addObject("deptId", ContextUtil.subDeptId(user));
|
view.addObject("type", InoutConstant.TYPE_OUT);
|
|
//出库流程
|
String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
|
ContextUtil.subDeptId(user), InoutConstant.TYPE_OUT);
|
view.addObject("inoutProgress", inoutProgress);
|
|
// 当前流程节点
|
view.addObject("progress", InoutConstant.PROGRESS_CARD_BACK);
|
|
// 粮食品种下拉框
|
List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
|
view.addObject("listFoodVariety", listFoodVariety);
|
|
// 粮食等级下拉框
|
List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
|
Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
|
view.addObject("listFoodLevel", listFoodLevel);
|
|
view.setViewName("admin/inout/out-card-back");
|
return view;
|
}
|
|
/**
|
* 出入库数据查询,根据条件查询数据,出入库数据信息
|
*
|
* @param param
|
* @return
|
*/
|
@RequestMapping("/inout-query")
|
public PageResponse<InoutData> inoutQuery(@RequestBody InoutParam param) {
|
return inoutManager.inoutQuery(param);
|
}
|
|
/**
|
* 卡回收数据查询,没有流程状态的数据直接返回
|
*
|
* @param param
|
* @return
|
*/
|
@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 {
|
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());
|
}
|
}
|
|
/**
|
* 卡回收页面提交,如果是正常流程卡回收则走正常完成流程,否则执行删除逻辑并回收卡
|
*
|
* @param data
|
* @return
|
*/
|
@RequestMapping("/inout-back-submit")
|
public PageResponse<InoutData> inoutBackSubmit(@RequestBody InoutData data) {
|
return inoutManager.inoutBack(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);
|
}
|
}
|
|
/**
|
* 根据卡号和类型,直接完成当前流程
|
*
|
* @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;
|
}
|
/**
|
* 更新用户选择地磅,根据用户IP保存期选择
|
*
|
* @param param 用参数中的key作为选择
|
* @return
|
*/
|
@RequestMapping("/update-select-weight")
|
public PageResponse<String> updateWeight(HttpServletRequest request, @RequestBody BaseParam param) {
|
try {
|
|
if (null == param.getKey()) {
|
return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
|
"后台异常:没有获取到用户选择地磅");
|
}
|
|
commonManager.setInoutWeightByClient(request, param.getKey());
|
|
return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "更新成功");
|
|
} catch (Exception e) {
|
return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
|
"后台异常:" + e.getMessage());
|
}
|
}
|
}
|