|
@@ -2,6 +2,7 @@ package com.minpay.shouhuo.equmentaction;
|
|
|
|
|
|
import com.min.util.CommonUtil;
|
|
|
import com.minpay.common.bean.User;
|
|
|
+import com.minpay.common.constant.Constant;
|
|
|
import com.minpay.common.format.IFormatService;
|
|
|
import com.minpay.common.util.DateUtil;
|
|
|
import com.minpay.db.table.mapper.VmEquipmentInfMapper;
|
|
@@ -52,6 +53,9 @@ public class MachineManageAction implements IMINAction {
|
|
|
/**一键补货*/
|
|
|
public final static String ADD_PROEQUREL_NUM = "addProEquRelNum";
|
|
|
|
|
|
+ /**补货*/
|
|
|
+ public final static String EDIT_PROEQUREL_NUM = "editProEquRelNum";
|
|
|
+
|
|
|
private boolean contains;
|
|
|
|
|
|
|
|
@@ -236,4 +240,48 @@ public class MachineManageAction implements IMINAction {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 补货
|
|
|
+ * @param perId 设备id
|
|
|
+ * @param session
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ */
|
|
|
+ @MINAction(value = EDIT_PROEQUREL_NUM)
|
|
|
+ public MINActionResult editProEquRelNum(
|
|
|
+ @MINParam(key = "perId") String perId,//货道Id
|
|
|
+ @MINParam(key = "proNum") String proNum,//补货数量
|
|
|
+ MINSession session
|
|
|
+ ) throws MINBusinessException {
|
|
|
+
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ //当前时间
|
|
|
+ String dateTime = DateUtil.getCurrentDateTimeString();
|
|
|
+ User user = session.getUser();
|
|
|
+ //操作员id
|
|
|
+ String userId = user.getId();
|
|
|
+ //渠道
|
|
|
+// String channel = user.getChannel();
|
|
|
+ //校验设备是否正常
|
|
|
+ VmProEquRel equRel = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmProEquRelMapper.class)
|
|
|
+ .selectByPrimaryKey(perId);
|
|
|
+ String proNumall = equRel.getCargoWayNums();
|
|
|
+ int comcosAndsal = CommonUtil.compare(proNum, proNumall);
|
|
|
+ if (comcosAndsal == 1 ) {
|
|
|
+ throw new MINBusinessException("补货量不能大于货道容量!");
|
|
|
+ }
|
|
|
+ if(equRel == null||equRel.getExeitState().equals(Constant.PROEQUREL_STT_02)){
|
|
|
+ throw new MINBusinessException("设备中该货物不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ equRel.setProductNums(proNum); //商品余量修改为货道容量
|
|
|
+ equRel.setModifyUser(userId); //最后修改人
|
|
|
+ equRel.setModifyTime(dateTime); //最后修改时间
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmProEquRelMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(equRel);
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|