|
|
@@ -40,35 +40,69 @@ import java.util.Map;
|
|
|
@MINComponent
|
|
|
public class MachineManageAction implements IMINAction {
|
|
|
|
|
|
- /**查看设备*/
|
|
|
+ /**
|
|
|
+ * 查看设备
|
|
|
+ */
|
|
|
public final static String QUERY_EQUMENT_INF = "queryEqumentInf";
|
|
|
- /** 添加设备*/
|
|
|
+ /**
|
|
|
+ * 添加设备
|
|
|
+ */
|
|
|
public final static String ADD_PRODUCT_INF = "addProductInf";
|
|
|
- /** 修改设备*/
|
|
|
+ /**
|
|
|
+ * 修改设备
|
|
|
+ */
|
|
|
public final static String MODIFY_PRODUCT_INF = "modifyProductInf";
|
|
|
- /** 更改设备状态*/
|
|
|
+ /**
|
|
|
+ * 更改设备状态
|
|
|
+ */
|
|
|
public final static String MODIFY_PRODUCT_STATE = "modifyProductState";
|
|
|
- /**查询设备中商品*/
|
|
|
- public final static String QUERY_PROEQUREL = "queryProEquRel";
|
|
|
- /**查看正常状态商品*/
|
|
|
+ /**
|
|
|
+ * 查询设备中商品
|
|
|
+ */
|
|
|
+ public final static String QUERY_PROEQUREL = "queryProEquRel";
|
|
|
+ /**
|
|
|
+ * 查看正常状态商品
|
|
|
+ */
|
|
|
public final static String QUERY_PRODUCTZ = "queryProductz";
|
|
|
- /**设备添加商品*/
|
|
|
- public final static String ADD_PROEQUREL = "addProEquRel";
|
|
|
- /**修改设备商品*/
|
|
|
- public final static String EDIT_PROEQUREL = "editProEquRel";
|
|
|
- /**查询编辑设备中商品*/
|
|
|
- public final static String QUERY_PROEQU = "queryProEqu";
|
|
|
- /**删除货道*/
|
|
|
- public final static String DEL_EQUPRO = "delEquPro";
|
|
|
- /**删除设备中商品*/
|
|
|
- public final static String DEL_PROEQU = "delProEqu";
|
|
|
+ /**
|
|
|
+ * 设备添加商品
|
|
|
+ */
|
|
|
+ public final static String ADD_PROEQUREL = "addProEquRel";
|
|
|
+ /**
|
|
|
+ * 修改设备商品
|
|
|
+ */
|
|
|
+ public final static String EDIT_PROEQUREL = "editProEquRel";
|
|
|
+ /**
|
|
|
+ * 查询编辑设备中商品
|
|
|
+ */
|
|
|
+ public final static String QUERY_PROEQU = "queryProEqu";
|
|
|
+ /**
|
|
|
+ * 删除货道
|
|
|
+ */
|
|
|
+ public final static String DEL_EQUPRO = "delEquPro";
|
|
|
+ /**
|
|
|
+ * 删除设备中商品
|
|
|
+ */
|
|
|
+ public final static String DEL_PROEQU = "delProEqu";
|
|
|
+ /**
|
|
|
+ * 查询设备列表
|
|
|
+ */
|
|
|
+ public final static String QUERY_EQUIPMENT_LINE = "queryEquipmentLine";
|
|
|
+ /**
|
|
|
+ * 多选设备复制商品
|
|
|
+ */
|
|
|
+ public final static String ADD_PROEQURELALL_COPY = "addProEquRelAllCopy";
|
|
|
+ /**
|
|
|
+ * 关闭音乐
|
|
|
+ */
|
|
|
+ public final static String CLOSE_SONG = "closeSong";
|
|
|
private boolean contains;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查看设备
|
|
|
- * @param createUser 添加人
|
|
|
-
|
|
|
+ *
|
|
|
+ * @param createUser 添加人
|
|
|
* @param page
|
|
|
* @param limit
|
|
|
* @return
|
|
|
@@ -76,7 +110,7 @@ public class MachineManageAction implements IMINAction {
|
|
|
*/
|
|
|
@MINAction(value = QUERY_EQUMENT_INF)
|
|
|
public MINActionResult queryEqumentInf(
|
|
|
- @MINParam(key = "machineId")String machineId,
|
|
|
+ @MINParam(key = "machineId") String machineId,
|
|
|
@MINParam(key = "state") String state,
|
|
|
@MINParam(key = "createUser") String createUser,
|
|
|
@MINParam(key = "page", defaultValue = "1") int page,
|
|
|
@@ -88,8 +122,8 @@ public class MachineManageAction implements IMINAction {
|
|
|
String passwardKey = Service.lookup(IPropertiesService.class)
|
|
|
.getSystemProperties().get("WALLET_TO_METTING_PASSWORD_KEY").getKey();
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
- map.put("id",machineId);
|
|
|
- map.put("createUser",createUser);
|
|
|
+ map.put("id", machineId);
|
|
|
+ map.put("createUser", createUser);
|
|
|
map.put("channel", user.getChannel());//渠道号
|
|
|
//验证操作员权限
|
|
|
MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
@@ -98,22 +132,23 @@ public class MachineManageAction implements IMINAction {
|
|
|
.getMybatisMapper(MachineManageMapper.class)
|
|
|
.machineInf(map, rows);
|
|
|
//格式化时间和状态
|
|
|
- list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime","modifyTime");
|
|
|
- list = new MINCopyFormat("{state:'stateDesc'}").format(list);
|
|
|
- list = Service.lookup(IFormatService.class).formatEnum(list,"{stateDesc:'MEI_STATE'}");
|
|
|
+ list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime", "modifyTime");
|
|
|
+ list = new MINCopyFormat("{state:'stateDesc',equType :'equTypeDesc'}").format(list);
|
|
|
+ list = Service.lookup(IFormatService.class).formatEnum(list, "{stateDesc:'EQUIPMENT_STATE',equTypeDesc:'EQUIPMENT_TYPE'}");
|
|
|
//返回数据
|
|
|
res.set(IMINBusinessConstant.F_PAGING_LAY, list);
|
|
|
- res.set(IMINBusinessConstant.F_PAGING_COUNT,rows.getMaxRows());
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 添加设备
|
|
|
+ *
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
*/
|
|
|
- @MINAction(value = ADD_PRODUCT_INF,transaction = IMINTransactionEnum.CMT)
|
|
|
+ @MINAction(value = ADD_PRODUCT_INF, transaction = IMINTransactionEnum.CMT)
|
|
|
public MINActionResult addMachine(
|
|
|
@MINParam(key = "equCode") String equCode,
|
|
|
@MINParam(key = "account") String account,
|
|
|
@@ -126,16 +161,16 @@ public class MachineManageAction implements IMINAction {
|
|
|
String nowTime = DateUtil.getCurrentDateTimeString();
|
|
|
// 获取操作员信息
|
|
|
User user = session.getUser();
|
|
|
- if (CommonUtil.isEmpty(equCode)){
|
|
|
+ if (CommonUtil.isEmpty(equCode)) {
|
|
|
throw new MINBusinessException("起始机台号为空");
|
|
|
}
|
|
|
- if (CommonUtil.isEmpty(account)){
|
|
|
+ if (CommonUtil.isEmpty(account)) {
|
|
|
throw new MINBusinessException("生成数量为空");
|
|
|
}
|
|
|
- if (CommonUtil.isEmpty(temLine)){
|
|
|
+ if (CommonUtil.isEmpty(temLine)) {
|
|
|
throw new MINBusinessException("生成货道行数量为空");
|
|
|
}
|
|
|
- if (CommonUtil.isEmpty(temRow)){
|
|
|
+ if (CommonUtil.isEmpty(temRow)) {
|
|
|
throw new MINBusinessException("生成货道列数量为空");
|
|
|
}
|
|
|
int size = Integer.parseInt(account);
|
|
|
@@ -144,17 +179,17 @@ public class MachineManageAction implements IMINAction {
|
|
|
List<VmEquipmentInf> vmEquipmentInfList = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
.selectByExample(example);
|
|
|
- if (vmEquipmentInfList.size()>0){
|
|
|
- throw new MINBusinessException(equCode+"机台号已存在");
|
|
|
+ if (vmEquipmentInfList.size() > 0) {
|
|
|
+ throw new MINBusinessException(equCode + "机台号已存在");
|
|
|
}
|
|
|
- for (int j = 1; j<size;j++ ){
|
|
|
+ for (int j = 1; j < size; j++) {
|
|
|
VmEquipmentInfExample examples = new VmEquipmentInfExample();
|
|
|
- examples.createCriteria().andMachineNoEqualTo(CommonUtil.add(equCode,String.valueOf(j))).andStateEqualTo("00");
|
|
|
+ examples.createCriteria().andMachineNoEqualTo(CommonUtil.add(equCode, String.valueOf(j))).andStateEqualTo("00");
|
|
|
List<VmEquipmentInf> vmEquipmentInfLists = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
.selectByExample(examples);
|
|
|
- if (vmEquipmentInfLists.size()>0){
|
|
|
- throw new MINBusinessException(equCode+"机台号已存在");
|
|
|
+ if (vmEquipmentInfLists.size() > 0) {
|
|
|
+ throw new MINBusinessException(equCode + "机台号已存在");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -171,12 +206,12 @@ public class MachineManageAction implements IMINAction {
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(com.minpay.db.table.mapper.VmEquipmentInfMapper.class)
|
|
|
.insertSelective(pro);
|
|
|
- for (int i = 1; i < size;i++ ){
|
|
|
+ for (int i = 1; i < size; i++) {
|
|
|
String ids = Service.lookup(IPublicService.class).getSequence("EQU_MACHINE_NO");
|
|
|
VmEquipmentInf pros = new VmEquipmentInf();
|
|
|
pros.setId(ids);
|
|
|
pros.setChannel("V01");
|
|
|
- pros.setMachineNo(CommonUtil.add(equCode,String.valueOf(i)));
|
|
|
+ pros.setMachineNo(CommonUtil.add(equCode, String.valueOf(i)));
|
|
|
pros.setState("00");
|
|
|
pros.setCreateUser(user.getId());
|
|
|
pros.setCreateTime(nowTime);
|
|
|
@@ -191,10 +226,10 @@ public class MachineManageAction implements IMINAction {
|
|
|
Service.lookup(ILogService.class).logging(session, logInfo);*/
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询设备中商品
|
|
|
- * @param temName 模版名称
|
|
|
- * @param temState 状态
|
|
|
+ *
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
@@ -218,20 +253,22 @@ public class MachineManageAction implements IMINAction {
|
|
|
.getMybatisMapper(MachineManageMapper.class)
|
|
|
.queryProEquRel(map);
|
|
|
//格式化时间和状态
|
|
|
- list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime","modifyTime");
|
|
|
+ list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime", "modifyTime");
|
|
|
list = new MINCopyFormat("{perState:'sttDesc',isPromotton:'isPromottonDesc',isFragile:'isFragileDesc'}").format(list);
|
|
|
list = Service.lookup(IFormatService.class).formatEnum(list, "{sttDesc:'PROEQUREL_STATE',isPromottonDesc:'IS_PROMOTION',isFragileDesc:'IS_FRAGILE'}");
|
|
|
//传递数据
|
|
|
res.set(IMINBusinessConstant.F_PAGING_LAY, list);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查看商品
|
|
|
- * @param name 商品名称
|
|
|
- * @param brandName 品牌名称
|
|
|
- * @param model 商品型号
|
|
|
- * @param createUser 添加人
|
|
|
- * @param dates 添加时间
|
|
|
+ *
|
|
|
+ * @param name 商品名称
|
|
|
+ * @param brandName 品牌名称
|
|
|
+ * @param model 商品型号
|
|
|
+ * @param createUser 添加人
|
|
|
+ * @param dates 添加时间
|
|
|
* @param page
|
|
|
* @param limit
|
|
|
* @return
|
|
|
@@ -241,7 +278,7 @@ public class MachineManageAction implements IMINAction {
|
|
|
public MINActionResult queryProductz(
|
|
|
@MINParam(key = "name") String name,
|
|
|
@MINParam(key = "model") String model,
|
|
|
- @MINParam(key = "dates")String dates,
|
|
|
+ @MINParam(key = "dates") String dates,
|
|
|
@MINParam(key = "state") String state,
|
|
|
@MINParam(key = "brandName") String brandName,
|
|
|
@MINParam(key = "categoryId") String categoryId,
|
|
|
@@ -254,17 +291,17 @@ public class MachineManageAction implements IMINAction {
|
|
|
User user = session.getUser();
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
//按商品名称,商品品牌进行模糊查询
|
|
|
- map.put("name", name); //商品名称
|
|
|
+ map.put("name", name); //商品名称
|
|
|
map.put("state", state);//状态
|
|
|
- map.put("model",model);
|
|
|
- map.put("dates",dates);
|
|
|
- map.put("brandName",brandName);
|
|
|
- map.put("createUser",createUser);
|
|
|
+ map.put("model", model);
|
|
|
+ map.put("dates", dates);
|
|
|
+ map.put("brandName", brandName);
|
|
|
+ map.put("createUser", createUser);
|
|
|
map.put("channel", "V01");//渠道号
|
|
|
map.put("category", categoryId);//分类
|
|
|
//验证操作员权限
|
|
|
- if("00".equals(user.getIdentity())){
|
|
|
- map.put("userId",user.getId());
|
|
|
+ if ("00".equals(user.getIdentity())) {
|
|
|
+ map.put("userId", user.getId());
|
|
|
}
|
|
|
/* if("10000002".equals(user.getRoleId())){
|
|
|
map.put("userId",user.getId());
|
|
|
@@ -276,29 +313,31 @@ public class MachineManageAction implements IMINAction {
|
|
|
.getMybatisMapper(MachineManageMapper.class)
|
|
|
.queryProductz(map, rows);
|
|
|
//格式化时间和状态
|
|
|
- list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime","modifyTime");
|
|
|
+ list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime", "modifyTime");
|
|
|
list = new MINCopyFormat("{history:'historyDesc',state:'stateDesc',source:'sourceDesc'}").format(list);
|
|
|
- list = Service.lookup(IFormatService.class).formatEnum(list,"{historyDesc:'PRODUCT_HISTORY',stateDesc:'PRODUCT_STATE',sourceDesc:'PRODUCT_SOURCE'}");
|
|
|
+ list = Service.lookup(IFormatService.class).formatEnum(list, "{historyDesc:'PRODUCT_HISTORY',stateDesc:'PRODUCT_STATE',sourceDesc:'PRODUCT_SOURCE'}");
|
|
|
//返回数据
|
|
|
res.set(IMINBusinessConstant.F_PAGING_LAY, list);
|
|
|
- res.set(IMINBusinessConstant.F_PAGING_COUNT,rows.getMaxRows());
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 设备添加商品
|
|
|
- * @param perRow 货道层
|
|
|
- * @param perLine 货道列
|
|
|
- * @param perNum 货道容量
|
|
|
- * @param numbers 商品余量
|
|
|
- * @param sallPrice 售货价
|
|
|
- * @param gamePrice 游戏价
|
|
|
- * @param costPrice 成本价
|
|
|
- * @param isPromotton 是否促销
|
|
|
- * @param promottonPrice 促销价
|
|
|
- * @param isFragile 是否易碎
|
|
|
- * @param perRemarks 备注
|
|
|
- * @param proId 商品id
|
|
|
- * @param equId 设备id
|
|
|
+ *
|
|
|
+ * @param perRow 货道层
|
|
|
+ * @param perLine 货道列
|
|
|
+ * @param perNum 货道容量
|
|
|
+ * @param numbers 商品余量
|
|
|
+ * @param sallPrice 售货价
|
|
|
+ * @param gamePrice 游戏价
|
|
|
+ * @param costPrice 成本价
|
|
|
+ * @param isPromotton 是否促销
|
|
|
+ * @param promottonPrice 促销价
|
|
|
+ * @param isFragile 是否易碎
|
|
|
+ * @param perRemarks 备注
|
|
|
+ * @param proId 商品id
|
|
|
+ * @param equId 设备id
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
@@ -336,9 +375,9 @@ public class MachineManageAction implements IMINAction {
|
|
|
VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
.selectByPrimaryKey(equId);
|
|
|
- if(equipmentInf == null){
|
|
|
+ if (equipmentInf == null) {
|
|
|
throw new MINBusinessException("该设备不存在!");
|
|
|
- }else if(equipmentInf.getState().equals("03")){
|
|
|
+ } else if (equipmentInf.getState().equals("03")) {
|
|
|
throw new MINBusinessException("该设备已销毁!");
|
|
|
}
|
|
|
int comcosAndsal = CommonUtil.compare(costPrice, sallPrice);
|
|
|
@@ -362,7 +401,7 @@ public class MachineManageAction implements IMINAction {
|
|
|
if (comproAndsal == 1 || comproAndsal == 0) {
|
|
|
throw new MINBusinessException("促销价不能大于或等于售货价!");
|
|
|
}
|
|
|
- if (comnumAndper == 1 ) {
|
|
|
+ if (comnumAndper == 1) {
|
|
|
throw new MINBusinessException("商品余量不能大于货道容量!");
|
|
|
}
|
|
|
//校验商品是否正常
|
|
|
@@ -375,12 +414,12 @@ public class MachineManageAction implements IMINAction {
|
|
|
//设备新增商品
|
|
|
String id = Service.lookup(IPublicService.class).getSequence("VM_PROEQUREL_ID");
|
|
|
VmProEquRel proEquRel = new VmProEquRel();
|
|
|
- proEquRel.setId(id); //设备商品关联表id
|
|
|
- proEquRel.setProductId(proId); //商品id
|
|
|
- proEquRel.setEquipmentId(equId); //设备id
|
|
|
+ proEquRel.setId(id); //设备商品关联表id
|
|
|
+ proEquRel.setProductId(proId); //商品id
|
|
|
+ proEquRel.setEquipmentId(equId); //设备id
|
|
|
|
|
|
VmProEquRelExample example = new VmProEquRelExample();
|
|
|
- if(CommonUtil.isEmpty(aisle)){
|
|
|
+ if (CommonUtil.isEmpty(aisle)) {
|
|
|
example.createCriteria().andChannelEqualTo(channel)
|
|
|
.andEquipmentIdEqualTo(equId)
|
|
|
.andAisleEqualTo(perRow.concat(perLine))
|
|
|
@@ -388,11 +427,11 @@ public class MachineManageAction implements IMINAction {
|
|
|
List<VmProEquRel> list = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmProEquRelMapper.class)
|
|
|
.selectByExample(example);
|
|
|
- if(list.size() != 0){
|
|
|
+ if (list.size() != 0) {
|
|
|
throw new MINBusinessException("该设备默认货道指令已被使用!");
|
|
|
}
|
|
|
- proEquRel.setAisle(perRow.concat(perLine)); //货道指令
|
|
|
- }else{
|
|
|
+ proEquRel.setAisle(perRow.concat(perLine)); //货道指令
|
|
|
+ } else {
|
|
|
example.createCriteria().andChannelEqualTo(channel)
|
|
|
.andEquipmentIdEqualTo(equId)
|
|
|
.andAisleEqualTo(aisle)
|
|
|
@@ -400,53 +439,56 @@ public class MachineManageAction implements IMINAction {
|
|
|
List<VmProEquRel> list = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmProEquRelMapper.class)
|
|
|
.selectByExample(example);
|
|
|
- if(list.size() != 0){
|
|
|
+ if (list.size() != 0) {
|
|
|
throw new MINBusinessException("该设备货道指令已使用!");
|
|
|
}
|
|
|
- proEquRel.setAisle(aisle); //货道指令
|
|
|
- }
|
|
|
- proEquRel.setCargoWayRow(perRow); //货道层
|
|
|
- proEquRel.setCargoWayLine(perLine); //货道列
|
|
|
- proEquRel.setCargoWayNums(perNum); //货道容量
|
|
|
- proEquRel.setProductNums(numbers); //商品余量
|
|
|
- proEquRel.setSallPrice(sallPrice); //售货价
|
|
|
- proEquRel.setGamePrice(gamePrice); //游戏价
|
|
|
- proEquRel.setCostPrice(costPrice); //成本价
|
|
|
- proEquRel.setIsPromotion(isPromotton); //是否促销
|
|
|
- proEquRel.setPromotionPrice(promottonPrice); //促销价
|
|
|
+ proEquRel.setAisle(aisle); //货道指令
|
|
|
+ }
|
|
|
+ proEquRel.setCargoWayRow(perRow); //货道层
|
|
|
+ proEquRel.setCargoWayLine(perLine); //货道列
|
|
|
+ proEquRel.setCargoWayNums(perNum); //货道容量
|
|
|
+ proEquRel.setProductNums(numbers); //商品余量
|
|
|
+ proEquRel.setSallPrice(sallPrice); //售货价
|
|
|
+ proEquRel.setGamePrice(gamePrice); //游戏价
|
|
|
+ proEquRel.setCostPrice(costPrice); //成本价
|
|
|
+ proEquRel.setIsPromotion(isPromotton); //是否促销
|
|
|
+ proEquRel.setPromotionPrice(promottonPrice); //促销价
|
|
|
/* proEquRel.setIsFragile(isFragile); //是否易碎
|
|
|
- */ proEquRel.setUserId(uId); //商户id
|
|
|
- proEquRel.setRemarks(perRemarks); //备注
|
|
|
- proEquRel.setGameType(type); //游戏类型
|
|
|
- proEquRel.setChannel(channel); //渠道
|
|
|
- proEquRel.setCreateUser(uId); //创建人
|
|
|
- proEquRel.setCreateTime(dateTime); //创建时间
|
|
|
- proEquRel.setModifyUser(uId); //最后修改人
|
|
|
- proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
- proEquRel.setExeitState("00"); //状态 00正常
|
|
|
+ */
|
|
|
+ proEquRel.setUserId(uId); //商户id
|
|
|
+ proEquRel.setRemarks(perRemarks); //备注
|
|
|
+ proEquRel.setGameType(type); //游戏类型
|
|
|
+ proEquRel.setChannel(channel); //渠道
|
|
|
+ proEquRel.setCreateUser(uId); //创建人
|
|
|
+ proEquRel.setCreateTime(dateTime); //创建时间
|
|
|
+ proEquRel.setModifyUser(uId); //最后修改人
|
|
|
+ proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
+ proEquRel.setExeitState("00"); //状态 00正常
|
|
|
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmProEquRelMapper.class)
|
|
|
.insertSelective(proEquRel);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 修改设备商品
|
|
|
- * @param perId 设备商品关联id
|
|
|
- * @param perRow 货道层
|
|
|
- * @param perLine 货道列
|
|
|
- * @param perNum 货道容量
|
|
|
- * @param numbers 商品余量
|
|
|
- * @param sallPrice 售货价
|
|
|
- * @param gamePrice 游戏价
|
|
|
- * @param costPrice 成本价
|
|
|
- * @param isPromotton 是否促销
|
|
|
- * @param promottonPrice 促销价
|
|
|
- * @param isFragile 是否易碎
|
|
|
- * @param perRemarks 备注
|
|
|
- * @param proId 商品id
|
|
|
- * @param equId 设备id
|
|
|
- * @param perState 状态
|
|
|
+ *
|
|
|
+ * @param perId 设备商品关联id
|
|
|
+ * @param perRow 货道层
|
|
|
+ * @param perLine 货道列
|
|
|
+ * @param perNum 货道容量
|
|
|
+ * @param numbers 商品余量
|
|
|
+ * @param sallPrice 售货价
|
|
|
+ * @param gamePrice 游戏价
|
|
|
+ * @param costPrice 成本价
|
|
|
+ * @param isPromotton 是否促销
|
|
|
+ * @param promottonPrice 促销价
|
|
|
+ * @param isFragile 是否易碎
|
|
|
+ * @param perRemarks 备注
|
|
|
+ * @param proId 商品id
|
|
|
+ * @param equId 设备id
|
|
|
+ * @param perState 状态
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
@@ -486,9 +528,9 @@ public class MachineManageAction implements IMINAction {
|
|
|
VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
.selectByPrimaryKey(equId);
|
|
|
- if(equipmentInf == null){
|
|
|
+ if (equipmentInf == null) {
|
|
|
throw new MINBusinessException("该设备不存在!");
|
|
|
- }else if(equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)){
|
|
|
+ } else if (equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)) {
|
|
|
throw new MINBusinessException("该设备已销毁!");
|
|
|
}
|
|
|
int comcosAndsal = CommonUtil.compare(costPrice, sallPrice);
|
|
|
@@ -512,7 +554,7 @@ public class MachineManageAction implements IMINAction {
|
|
|
if (comproAndsal == 1 || comproAndsal == 0) {
|
|
|
throw new MINBusinessException("促销价不能大于或等于售货价!");
|
|
|
}
|
|
|
- if (comnumAndper == 1 ) {
|
|
|
+ if (comnumAndper == 1) {
|
|
|
throw new MINBusinessException("商品余量不能大于货道容量!");
|
|
|
}
|
|
|
//校验商品是否正常
|
|
|
@@ -526,13 +568,13 @@ public class MachineManageAction implements IMINAction {
|
|
|
// throw new BusinessCodeException("JINM0123");//商品信息异常
|
|
|
// }
|
|
|
//修改设备新增商品
|
|
|
- if(!CommonUtil.isEmpty(proId)){
|
|
|
- proEquRel.setProductId(proId); //商品id
|
|
|
+ if (!CommonUtil.isEmpty(proId)) {
|
|
|
+ proEquRel.setProductId(proId); //商品id
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(equId)){
|
|
|
- proEquRel.setEquipmentId(equId); //设备id
|
|
|
+ if (!CommonUtil.isEmpty(equId)) {
|
|
|
+ proEquRel.setEquipmentId(equId); //设备id
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(aisle)){
|
|
|
+ if (!CommonUtil.isEmpty(aisle)) {
|
|
|
VmProEquRelExample example = new VmProEquRelExample();
|
|
|
example.createCriteria().andChannelEqualTo(channel)
|
|
|
.andEquipmentIdEqualTo(equId)
|
|
|
@@ -542,49 +584,49 @@ public class MachineManageAction implements IMINAction {
|
|
|
List<VmProEquRel> list = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmProEquRelMapper.class)
|
|
|
.selectByExample(example);
|
|
|
- if(list.size() != 0){
|
|
|
+ if (list.size() != 0) {
|
|
|
throw new MINBusinessException("该设备货道指令已使用!");
|
|
|
}
|
|
|
- proEquRel.setAisle(aisle); //货道指令
|
|
|
+ proEquRel.setAisle(aisle); //货道指令
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(perRow)){
|
|
|
- proEquRel.setCargoWayRow(perRow); //货道层
|
|
|
+ if (!CommonUtil.isEmpty(perRow)) {
|
|
|
+ proEquRel.setCargoWayRow(perRow); //货道层
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(perLine)){
|
|
|
- proEquRel.setCargoWayLine(perLine); //货道列
|
|
|
+ if (!CommonUtil.isEmpty(perLine)) {
|
|
|
+ proEquRel.setCargoWayLine(perLine); //货道列
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(perNum)){
|
|
|
- proEquRel.setCargoWayNums(perNum); //货道容量
|
|
|
+ if (!CommonUtil.isEmpty(perNum)) {
|
|
|
+ proEquRel.setCargoWayNums(perNum); //货道容量
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(numbers)){
|
|
|
- proEquRel.setProductNums(numbers); //商品余量
|
|
|
+ if (!CommonUtil.isEmpty(numbers)) {
|
|
|
+ proEquRel.setProductNums(numbers); //商品余量
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(sallPrice)){
|
|
|
- proEquRel.setSallPrice(sallPrice); //售货价
|
|
|
+ if (!CommonUtil.isEmpty(sallPrice)) {
|
|
|
+ proEquRel.setSallPrice(sallPrice); //售货价
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(gamePrice)){
|
|
|
- proEquRel.setGamePrice(gamePrice); //游戏价
|
|
|
+ if (!CommonUtil.isEmpty(gamePrice)) {
|
|
|
+ proEquRel.setGamePrice(gamePrice); //游戏价
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(costPrice)){
|
|
|
- proEquRel.setCostPrice(costPrice); //成本价
|
|
|
+ if (!CommonUtil.isEmpty(costPrice)) {
|
|
|
+ proEquRel.setCostPrice(costPrice); //成本价
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(isPromotton)){
|
|
|
- proEquRel.setIsPromotion(isPromotton); //是否促销
|
|
|
+ if (!CommonUtil.isEmpty(isPromotton)) {
|
|
|
+ proEquRel.setIsPromotion(isPromotton); //是否促销
|
|
|
}
|
|
|
- if(!CommonUtil.isEmpty(promottonPrice)){
|
|
|
- proEquRel.setPromotionPrice(promottonPrice); //促销价
|
|
|
+ if (!CommonUtil.isEmpty(promottonPrice)) {
|
|
|
+ proEquRel.setPromotionPrice(promottonPrice); //促销价
|
|
|
}
|
|
|
/*if(!CommonUtil.isEmpty(isFragile)){
|
|
|
proEquRel.setIsFragile(isFragile); //是否易碎
|
|
|
}*/
|
|
|
- if(!CommonUtil.isEmpty(perRemarks)){
|
|
|
- proEquRel.setRemarks(perRemarks); //备注
|
|
|
+ if (!CommonUtil.isEmpty(perRemarks)) {
|
|
|
+ proEquRel.setRemarks(perRemarks); //备注
|
|
|
}
|
|
|
- proEquRel.setGameType(type); //游戏类型
|
|
|
- proEquRel.setModifyUser(uId); //最后修改人
|
|
|
- proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
- if(!CommonUtil.isEmpty(perState)){
|
|
|
- proEquRel.setExeitState(perState); //状态
|
|
|
+ proEquRel.setGameType(type); //游戏类型
|
|
|
+ proEquRel.setModifyUser(uId); //最后修改人
|
|
|
+ proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
+ if (!CommonUtil.isEmpty(perState)) {
|
|
|
+ proEquRel.setExeitState(perState); //状态
|
|
|
}
|
|
|
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
@@ -592,10 +634,10 @@ public class MachineManageAction implements IMINAction {
|
|
|
.updateByPrimaryKeySelective(proEquRel);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询设备中商品
|
|
|
- * @param temName 模版名称
|
|
|
- * @param temState 状态
|
|
|
+ *
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
@@ -621,19 +663,19 @@ public class MachineManageAction implements IMINAction {
|
|
|
.getMybatisMapper(MachineManageMapper.class)
|
|
|
.queryProEquRel(map);
|
|
|
//格式化时间和状态
|
|
|
- list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime","modifyTime");
|
|
|
+ list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime", "modifyTime");
|
|
|
list = new MINCopyFormat("{perState:'sttDesc',isPromotton:'isPromottonDesc',isFragile:'isFragileDesc'}").format(list);
|
|
|
list = Service.lookup(IFormatService.class).formatEnum(list, "{sttDesc:'PROEQUREL_STATE',isPromottonDesc:'IS_PROMOTION',isFragileDesc:'IS_FRAGILE'}");
|
|
|
//传递数据
|
|
|
res.set(IMINBusinessConstant.F_PAGING_LAY, list);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 删除货道
|
|
|
- * @param perId 设备商品关联id
|
|
|
- * @param proId 商品id
|
|
|
- * @param equId 设备id
|
|
|
- * @param perState 状态
|
|
|
+ *
|
|
|
+ * @param equId 设备id
|
|
|
+ * @param perState 状态
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
@@ -659,9 +701,9 @@ public class MachineManageAction implements IMINAction {
|
|
|
VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
.selectByPrimaryKey(equId);
|
|
|
- if(equipmentInf == null){
|
|
|
+ if (equipmentInf == null) {
|
|
|
throw new MINBusinessException("该设备不存在!");
|
|
|
- }else if(equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)){
|
|
|
+ } else if (equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)) {
|
|
|
throw new MINBusinessException("该设备已销毁!");
|
|
|
}
|
|
|
VmProEquRelExample equRelExample = new VmProEquRelExample();
|
|
|
@@ -673,36 +715,36 @@ public class MachineManageAction implements IMINAction {
|
|
|
List<VmProEquRel> list = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmProEquRelMapper.class)
|
|
|
.selectByExample(equRelExample);
|
|
|
- if(list.size() != 0){
|
|
|
+ if (list.size() != 0) {
|
|
|
throw new MINBusinessException("此货道无法删除!");
|
|
|
}
|
|
|
//删除货道
|
|
|
String id = Service.lookup(IPublicService.class).getSequence("VM_PROEQUREL_ID");
|
|
|
VmProEquRel proEquRel = new VmProEquRel();
|
|
|
- proEquRel.setId(id); //设备商品关联表id
|
|
|
- proEquRel.setEquipmentId(equId); //设备id
|
|
|
- proEquRel.setCargoWayRow(perRow); //货道层
|
|
|
- proEquRel.setCargoWayLine(perLine); //货道列
|
|
|
- proEquRel.setUserId(uId); //商户id
|
|
|
- proEquRel.setRemarks("货道删除"); //备注
|
|
|
- proEquRel.setChannel(channel); //渠道
|
|
|
- proEquRel.setCreateUser(uId); //创建人
|
|
|
- proEquRel.setCreateTime(dateTime); //创建时间
|
|
|
- proEquRel.setModifyUser(uId); //最后修改人
|
|
|
- proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
- proEquRel.setExeitState(Constant.PROEQUREL_STT_01); //状态 01货道删除
|
|
|
+ proEquRel.setId(id); //设备商品关联表id
|
|
|
+ proEquRel.setEquipmentId(equId); //设备id
|
|
|
+ proEquRel.setCargoWayRow(perRow); //货道层
|
|
|
+ proEquRel.setCargoWayLine(perLine); //货道列
|
|
|
+ proEquRel.setUserId(uId); //商户id
|
|
|
+ proEquRel.setRemarks("货道删除"); //备注
|
|
|
+ proEquRel.setChannel(channel); //渠道
|
|
|
+ proEquRel.setCreateUser(uId); //创建人
|
|
|
+ proEquRel.setCreateTime(dateTime); //创建时间
|
|
|
+ proEquRel.setModifyUser(uId); //最后修改人
|
|
|
+ proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
+ proEquRel.setExeitState(Constant.PROEQUREL_STT_01); //状态 01货道删除
|
|
|
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmProEquRelMapper.class)
|
|
|
.insertSelective(proEquRel);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 删除
|
|
|
- * @param perId 设备商品关联id
|
|
|
- * @param proId 商品id
|
|
|
- * @param equId 设备id
|
|
|
- * @param perState 状态
|
|
|
+ *
|
|
|
+ * @param perId 设备商品关联id
|
|
|
+ * @param perState 状态
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
@@ -737,9 +779,9 @@ public class MachineManageAction implements IMINAction {
|
|
|
.selectByPrimaryKey(perId);
|
|
|
//删除
|
|
|
proEquRel.setId(perId);
|
|
|
- proEquRel.setExeitState(Constant.PROEQUREL_STT_02); //状态
|
|
|
- proEquRel.setModifyUser(uId); //最后修改人
|
|
|
- proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
+ proEquRel.setExeitState(Constant.PROEQUREL_STT_02); //状态
|
|
|
+ proEquRel.setModifyUser(uId); //最后修改人
|
|
|
+ proEquRel.setModifyTime(dateTime); //最后修改时间
|
|
|
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmProEquRelMapper.class)
|
|
|
@@ -747,4 +789,256 @@ public class MachineManageAction implements IMINAction {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询设备列表
|
|
|
+ *
|
|
|
+ * @param equName 设备名称
|
|
|
+ * @param equState 状态
|
|
|
+ * @param session
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ */
|
|
|
+ @MINAction(value = QUERY_EQUIPMENT_LINE)
|
|
|
+ public MINActionResult queryEquipmentLine(
|
|
|
+ @MINParam(key = "equName") String equName,
|
|
|
+ @MINParam(key = "machineNo") String machineNo,
|
|
|
+ @MINParam(key = "temId") String temId,
|
|
|
+ @MINParam(key = "userName") String userName,
|
|
|
+ @MINParam(key = "dates") String dates,
|
|
|
+ @MINParam(key = "equState") String equState,
|
|
|
+ @MINParam(key = "machineNomax") String machineNomax,
|
|
|
+ @MINParam(key = "machineNomin") String machineNomin,
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
+ @MINParam(key = "limit", defaultValue = "10") int limit,
|
|
|
+ MINSession session
|
|
|
+ ) throws MINBusinessException {
|
|
|
+
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+
|
|
|
+ MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
+
|
|
|
+ User user = session.getUser();
|
|
|
+ //操作员id
|
|
|
+ String uId = user.getId();
|
|
|
+ //渠道
|
|
|
+ String channel = user.getChannel();
|
|
|
+ // 查询条件
|
|
|
+ Map<String, String> map = new HashMap<String, String>();
|
|
|
+ map.put("channel", "V01");
|
|
|
+ map.put("equName", equName);
|
|
|
+ map.put("equState", equState);
|
|
|
+ map.put("temId", temId);
|
|
|
+ map.put("userName", userName);
|
|
|
+ map.put("dates", dates);
|
|
|
+ map.put("machineNo", machineNo);
|
|
|
+ map.put("machineNomax", machineNomax);
|
|
|
+ map.put("machineNomin", machineNomin);
|
|
|
+// if(user.getRoleId().equals("10000002")){
|
|
|
+// map.put("userId", uId);
|
|
|
+// }
|
|
|
+ if (user.getIdentity().equals("00")) {
|
|
|
+ map.put("userId", uId);
|
|
|
+ } else if (user.getIdentity().equals("91")) {
|
|
|
+ map.put("agentId", uId);
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(MachineManageMapper.class)
|
|
|
+ .queryEquipment(map, rows);
|
|
|
+ //格式化时间和状态
|
|
|
+ list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime", "modifyTime");
|
|
|
+ list = new MINCopyFormat("{equState:'sttDesc',type:'typeDesc'}").format(list);
|
|
|
+ list = Service.lookup(IFormatService.class).formatEnum(list, "{sttDesc:'EQUIPMENT_STATE','typeDesc':'GAME_TYPE'}");
|
|
|
+ //传递数据
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, list);
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 多选设备复制商品
|
|
|
+ *
|
|
|
+ * @param equId 设备id
|
|
|
+ * @param copyEquId 复制设备id
|
|
|
+ * @param session
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ */
|
|
|
+ @MINAction(value = ADD_PROEQURELALL_COPY, transaction = IMINTransactionEnum.CMT)
|
|
|
+ public MINActionResult addProEquRelAllCopy(
|
|
|
+ @MINParam(key = "equId") String equId,
|
|
|
+ @MINParam(key = "copyEquId") String copyEquId,
|
|
|
+ MINSession session
|
|
|
+ ) throws MINBusinessException {
|
|
|
+
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+
|
|
|
+
|
|
|
+ if (equId.indexOf(copyEquId) != -1) {
|
|
|
+ throw new MINBusinessException("不能选择相同设备!");
|
|
|
+ }
|
|
|
+ String[] equIdArr = equId.split(",");
|
|
|
+ for (int i = 0; i < equIdArr.length; i++) {
|
|
|
+ //当前时间
|
|
|
+ String dateTime = DateUtil.getCurrentDateTimeString();
|
|
|
+ User user = session.getUser();
|
|
|
+ //操作员id
|
|
|
+ String userId = user.getId();
|
|
|
+ //渠道
|
|
|
+ String channel = "V01";
|
|
|
+ //校验设备是否正常
|
|
|
+ VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
+ .selectByPrimaryKey(equIdArr[i]);
|
|
|
+ if (equipmentInf == null) {
|
|
|
+ throw new MINBusinessException("该设备不存在!");
|
|
|
+ } else if (equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)) {
|
|
|
+ throw new MINBusinessException("该设备已销毁!");
|
|
|
+ }
|
|
|
+ //查询设备中原有的商品
|
|
|
+ VmProEquRelExample proEquRelExample = new VmProEquRelExample();
|
|
|
+ proEquRelExample.createCriteria().andEquipmentIdEqualTo(equIdArr[i])
|
|
|
+ .andChannelEqualTo(channel)
|
|
|
+ .andExeitStateEqualTo(Constant.PROEQUREL_STT_00);
|
|
|
+ List<VmProEquRel> list = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmProEquRelMapper.class)
|
|
|
+ .selectByExample(proEquRelExample);
|
|
|
+
|
|
|
+ for (int j = 0; i < list.size(); j++) {
|
|
|
+ VmProEquRel equRel = list.get(j);
|
|
|
+ //设备新增商品
|
|
|
+ equRel.setExeitState(Constant.PROEQUREL_STT_02); //状态
|
|
|
+ equRel.setModifyUser(userId); //最后修改人
|
|
|
+ equRel.setModifyTime(dateTime); //最后修改时间
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmProEquRelMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(equRel);
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询设备中的商品
|
|
|
+ VmProEquRelExample proEquRelExample2 = new VmProEquRelExample();
|
|
|
+ proEquRelExample2.createCriteria().andEquipmentIdEqualTo(copyEquId)
|
|
|
+ .andChannelEqualTo(channel)
|
|
|
+ .andExeitStateEqualTo(Constant.PROEQUREL_STT_00);
|
|
|
+ List<VmProEquRel> list2 = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmProEquRelMapper.class)
|
|
|
+ .selectByExample(proEquRelExample2);
|
|
|
+ for (int j = 0; j < list2.size(); j++) {
|
|
|
+
|
|
|
+ VmProEquRel equRel2 = list2.get(j);
|
|
|
+ //设备新增商品
|
|
|
+ String id = Service.lookup(IPublicService.class).getSequence("VM_PROEQUREL_ID");
|
|
|
+ equRel2.setId(id); //设备商品关联id
|
|
|
+ equRel2.setEquipmentId(equIdArr[i]); //设备id
|
|
|
+ equRel2.setCreateUser(userId); //创建人
|
|
|
+ equRel2.setCreateTime(dateTime); //创建时间
|
|
|
+ equRel2.setModifyUser(userId); //最后修改人
|
|
|
+ equRel2.setModifyTime(dateTime); //最后修改时间
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmProEquRelMapper.class)
|
|
|
+ .insertSelective(equRel2);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ pro.setIotCardNumber(ioiCardNumber);
|
|
|
+ pro.setIotServiceProvider(ioiServicePrivider);
|
|
|
+ pro.setModifyUser(user.getId());
|
|
|
+ pro.setModifyTime(nowTime);
|
|
|
+ pro.setAddress(address);
|
|
|
+ pro.setEquType(equType);
|
|
|
+ pro.setWcAccount(wcAccount);
|
|
|
+ pro.setZfbAccount(zfbAccount);
|
|
|
+ pro.setCharge(charge);
|
|
|
+ pro.setPayeeNo(payeeNo);
|
|
|
+ pro.setCreditChannel(creditChannel);
|
|
|
+ pro.setPayment(payment);
|
|
|
+ pro.setPaymentType(paymentType);
|
|
|
+ pro.setExchangeRate(exchangeRate);
|
|
|
+ pro.setSupportBalance(supportBalance);
|
|
|
+ pro.setModifyUser(user.getId());
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 开启/关闭音乐
|
|
|
+ *
|
|
|
+ * @param id 机器id
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @MINAction(value = CLOSE_SONG)
|
|
|
+ public MINActionResult closeSong(
|
|
|
+ @MINParam(key = "id") String id,
|
|
|
+ @MINParam(key = "status") String status,
|
|
|
+ MINSession session) throws Exception {
|
|
|
+
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ User user = session.getUser();
|
|
|
+ if (CommonUtil.isEmpty(id)){
|
|
|
+ throw new MINBusinessException("机器id上送为空!");
|
|
|
+ }
|
|
|
+ //校验设备是否正常
|
|
|
+ VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
+ .selectByPrimaryKey(id);
|
|
|
+ if (equipmentInf == null) {
|
|
|
+ throw new MINBusinessException("该设备不存在!");
|
|
|
+ } else if (equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)) {
|
|
|
+ throw new MINBusinessException("该设备已销毁!");
|
|
|
+ }
|
|
|
+ VmEquipmentInf pro = new VmEquipmentInf();
|
|
|
+ pro.setId(id);
|
|
|
+ pro.setSongStatus(status);//关闭
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(pro);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|