租赁推送
This commit is contained in:
parent
432602333b
commit
0c0c5d9479
|
|
@ -5,17 +5,22 @@ import com.bonus.sgzb.app.domain.MaInputVO;
|
|||
import com.bonus.sgzb.app.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.app.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.app.service.PurchaseInputService;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 新购入库-app
|
||||
|
|
@ -77,5 +82,16 @@ public class PurchaseInputController extends BaseController {
|
|||
return toAjax(purchaseInputService.modifyManageStatus(maInputVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改机具状态
|
||||
* @param body
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改机具状态")
|
||||
@PostMapping("/updateStatus")
|
||||
public AjaxResult updateStatus(String body) {
|
||||
return toAjax(purchaseInputService.updateStatus(body));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.sgzb.app.domain.BackApplyInfo;
|
|||
import com.bonus.sgzb.app.domain.MaInputVO;
|
||||
import com.bonus.sgzb.app.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.app.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -49,4 +50,11 @@ public interface PurchaseInputService {
|
|||
* @return
|
||||
*/
|
||||
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo bean);
|
||||
|
||||
/**
|
||||
* 修改机具状态
|
||||
* @param body
|
||||
* @return
|
||||
*/
|
||||
int updateStatus(String body);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,34 @@
|
|||
package com.bonus.sgzb.app.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.sgzb.app.domain.*;
|
||||
import com.bonus.sgzb.app.mapper.PurchaseInputMapper;
|
||||
import com.bonus.sgzb.app.service.PurchaseInputService;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.base.domain.ItemPushInfo;
|
||||
import com.bonus.sgzb.common.core.constant.Constants;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.RsaUtil;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @author bns
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PurchaseInputServiceImpl implements PurchaseInputService {
|
||||
|
||||
@Resource
|
||||
|
|
@ -138,4 +148,51 @@ public class PurchaseInputServiceImpl implements PurchaseInputService {
|
|||
}
|
||||
return purchaseCheckInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改机具状态
|
||||
* @param body
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateStatus(String body) {
|
||||
try {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
Map<String, String> map = objectMapper.readValue(body, Map.class);
|
||||
String message = map.get("body");
|
||||
String decrypt = RsaUtil.decryptByPrivateKey(message, Constants.privateKey);
|
||||
ItemPushInfo itemPushInfo = objectMapper.readValue(decrypt, ItemPushInfo.class);
|
||||
MaMachine maMachine = new MaMachine();
|
||||
maMachine.setMaId(itemPushInfo.getMaId());
|
||||
maMachine.setMaStatus(String.valueOf(itemPushInfo.getMaStatus()));
|
||||
return purchaseInputMapper.updateMaMachine(maMachine);
|
||||
} catch (Exception e) {
|
||||
log.error("修改机具状态异常",e.getMessage());
|
||||
throw new RuntimeException("修改机具状态异常");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ItemPushInfo itemPushInfo = new ItemPushInfo();
|
||||
itemPushInfo.setMaId(1);
|
||||
itemPushInfo.setMaStatus(16);
|
||||
String content = JSONObject.toJSONString(itemPushInfo);
|
||||
String encrypt;
|
||||
try {
|
||||
encrypt = RsaUtil.encryptByPublicKey(content, Constants.publicKey);
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("body", encrypt);
|
||||
System.out.println(map);
|
||||
String body = JSONObject.toJSONString(map);
|
||||
System.out.println(body);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
Map<String, String> map1 = objectMapper.readValue(body, Map.class);
|
||||
String message = map1.get("body");
|
||||
String decrypt = RsaUtil.decryptByPrivateKey(message, Constants.privateKey);
|
||||
ItemPushInfo itemPushInfo1 = objectMapper.readValue(decrypt, ItemPushInfo.class);
|
||||
System.out.println(itemPushInfo1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author ma_sh
|
||||
* @create 2024/7/29 17:46
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ItemPushInfo {
|
||||
/**
|
||||
* 装备id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 仓储装备id
|
||||
*/
|
||||
private Integer maId;
|
||||
|
||||
/**
|
||||
* 物品种类
|
||||
*/
|
||||
private String itemType;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String deviceType;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specificationType;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String maCode;
|
||||
|
||||
/**
|
||||
* 仓储状态 1:在库,2:在用
|
||||
*/
|
||||
private Integer storageStatus;
|
||||
|
||||
/**
|
||||
* 租赁状态 1:信息未完善,2:信息已完善,3:待上架,4:待租,5:租赁中
|
||||
*/
|
||||
private Integer rentalStatus;
|
||||
|
||||
/**
|
||||
* 是否启用 0:不启用,1:启用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 维护后生成的item
|
||||
*/
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 机具状态
|
||||
*/
|
||||
private Integer maStatus;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue