Ver código fonte

优化修改机器

xubh 4 anos atrás
pai
commit
6945fd7e9c

+ 117 - 0
src/main/java/com/minpay/shouhuo/equmentaction/MachineManageAction.java

@@ -82,6 +82,10 @@ public class MachineManageAction implements IMINAction {
      * 查询货道
      */
     public final static String QUERY_PROEQURELONE = "queryProEquRelOne";
+    /**
+     * 修改设备
+     */
+    public final static String MODIFY_PRODUCT_INF = "modifyProductInf";
 
 
 
@@ -820,6 +824,119 @@ public class MachineManageAction implements IMINAction {
         return res;
     }
 
+    /**
+     * 编辑设备
+     *
+     * @param session
+     * @return
+     * @throws MINBusinessException
+     */
+    @MINAction(value = MODIFY_PRODUCT_INF, transaction = IMINTransactionEnum.CMT)
+    public MINActionResult modifyProductInf(
+            @MINParam(key = "id") String id,
+            @MINParam(key = "name") String name,
+            @MINParam(key = "ioiServicePrivider") String ioiServicePrivider,
+            @MINParam(key = "ioiCardNumber") String ioiCardNumber,
+            @MINParam(key = "address") String address,
+            @MINParam(key = "versionType") String versionType,
+            @MINParam(key = "equType") String equType,
+            @MINParam(key = "wcAccount") String wcAccount,
+            @MINParam(key = "zfbAccount") String zfbAccount,
+            @MINParam(key = "charge") String charge,
+            @MINParam(key = "payeeNo") String payeeNo,
+            @MINParam(key = "creditChannel") String creditChannel,
+            @MINParam(key = "payment") String payment,
+            @MINParam(key = "paymentType") String paymentType,
+            @MINParam(key = "exchangeRate") String exchangeRate,
+            @MINParam(key = "supportBalance") String supportBalance,
+            MINSession session) throws MINBusinessException {
+
+        MINActionResult res = new MINActionResult();
+        //获取当前时间
+        String nowTime = DateUtil.getCurrentDateTimeString();
+        // 获取操作员信息
+        User user = session.getUser();
+        VmEquipmentInf pro = new VmEquipmentInf();
+        pro.setId(id);
+        if (CommonUtil.isEmpty(name)){
+            pro.setName("无人售货机");
+        }else{
+            pro.setName(name);
+        }
+        if(!CommonUtil.isEmpty(name)){
+            pro.setIotCardNumber(ioiCardNumber);
+        }
+
+
+        if(!CommonUtil.isEmpty(ioiServicePrivider)){
+            pro.setIotServiceProvider(ioiServicePrivider);
+        }
+        if(!CommonUtil.isEmpty(user.getId())){
+            pro.setModifyUser(user.getId());
+        }
+        if(!CommonUtil.isEmpty(nowTime)){
+            pro.setModifyTime(nowTime);
+        }
+        if(!CommonUtil.isEmpty(address)){
+            pro.setAddress(address);
+        }
+
+        if(!CommonUtil.isEmpty(equType)){
+            pro.setEquType(equType);
+        }
+
 
 
+
+        if(!CommonUtil.isEmpty(wcAccount)){
+            pro.setWcAccount(wcAccount);
+        }
+        if(!CommonUtil.isEmpty(zfbAccount)){
+            pro.setZfbAccount(zfbAccount);
+        }
+
+
+
+        if(!CommonUtil.isEmpty(charge)){
+            pro.setCharge(charge);
+        }
+        if(!CommonUtil.isEmpty(payeeNo)){
+            pro.setPayeeNo(payeeNo);
+        }
+        if(!CommonUtil.isEmpty(creditChannel)){
+            pro.setCreditChannel(creditChannel);
+        }
+        if(!CommonUtil.isEmpty(payment)){
+            pro.setPayment(payment);
+        }
+        if(!CommonUtil.isEmpty(versionType)){
+            pro.setVersionType(versionType);
+        }
+
+        if(!CommonUtil.isEmpty(paymentType)){
+            pro.setPaymentType(paymentType);
+        }
+        if(!CommonUtil.isEmpty(exchangeRate)){
+            pro.setExchangeRate(exchangeRate);
+        }
+        if(!CommonUtil.isEmpty(supportBalance)){
+            pro.setSupportBalance(supportBalance);
+        }
+        if(!CommonUtil.isEmpty(user.getId())){
+            pro.setModifyUser(user.getId());
+        }
+        if(!CommonUtil.isEmpty(nowTime)){
+            pro.setModifyTime(nowTime);
+        }
+
+
+        Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmEquipmentInfMapper.class)
+                .updateByPrimaryKeySelective(pro);
+        // 记录操作日志
+        String logInfo = "操作员:" + user.getName() + "编辑设备,编号:" + id;
+        Service.lookup(ILogService.class).logging(session, logInfo);
+        return res;
+    }
+
 }