rev:合并修改

This commit is contained in:
2024-06-21 18:29:43 +08:00
parent 3a9e0275e9
commit 5a70b02fc3
2 changed files with 110 additions and 0 deletions

View File

@@ -136,6 +136,45 @@ public interface LmsToMesService {
*/ */
JSONObject ChildScrapUpdate(JSONObject jo); JSONObject ChildScrapUpdate(JSONObject jo);
/**
* 向飞书推送图片
* @param file_name : 图片名称
* @return {
* "RTYPE": "S",
* "RTMSG": "图片上传成功",
* "RTOAL": 0,
* "RSYS": null,
* "RTDAT": "img_v3_028m_594c5c05-e1d6-4b2c-8298-445f3df23d4g",
* "RTDAT2": null
* }
*/
JSONObject sendSalesIvtMsg(String file_name);
/**
* 向飞书推送业务员对应的图片参数
* @param param {
* "UserList": [
* {
* "User": "********" //用户工号列表
* }
* ],
* "Code": "*********", //卡片ID
* "card": { //卡片参数
* "**": {},
* "**": {}
* }
* }
* @return {
* "RTYPE": "S",
* "RTMSG": "消息发送成功",
* "RTOAL": 0,
* "RSYS": null,
* "RTDAT": null,
* "RTDAT2": null
* }
*/
JSONObject sendSalesIvtMsgParam(JSONObject param);
JSONObject momAutoTransterMoveIn(JSONObject jo); JSONObject momAutoTransterMoveIn(JSONObject jo);
JSONObject momGetPackingInfo(JSONObject jo); JSONObject momGetPackingInfo(JSONObject jo);

View File

@@ -701,6 +701,77 @@ public class LmsToMesServiceImpl implements LmsToMesService {
return result; return result;
} }
@Override
public JSONObject sendSalesIvtMsg(String file_name) {
JSONObject result = new JSONObject();
if (StrUtil.equals("0", is_connect_mes)) {
result.put("status", HttpStatus.OK.value());
result.put("message", "下发成功,但未连接飞书!");
result.put("data", new JSONObject());
return result;
}
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
String api = "/FeiShuNoticesWebApi/UploadImage";
url = url + api +"?fileName="+file_name;
log.info("sendSalesIvtMsg接口输入参数为-------------------" + url.toString());
try {
String resultMsg = HttpRequest.post(url)
.execute().body();
result = JSONObject.parseObject(resultMsg);
log.info("sendSalesIvtMsg接口输出参数为-------------------" + result.toString());
String RTYPE = result.getString("RTYPE");
if ("E".equals(RTYPE)) {
throw new BadRequestException(result.getString("RTMSG"));
}
} catch (Exception e) {
throw new BadRequestException("飞书提示错误:" + e.getMessage());
}
return result;
}
@Override
public JSONObject sendSalesIvtMsgParam(JSONObject param) {
log.info("sendSalesIvtMsgParam接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject();
if (StrUtil.equals("0", is_connect_mes)) {
result.put("status", HttpStatus.OK.value());
result.put("message", "下发成功,但未连接飞书!");
result.put("data", new JSONObject());
return result;
}
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
String api = "/FeiShuNoticesWebApi/SendCard";
url = url + api;
try {
String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param))
.execute().body();
result = JSONObject.parseObject(resultMsg);
log.info("sendSalesIvtMsgParam接口输出参数为-------------------" + result.toString());
String RTYPE = result.getString("RTYPE");
if ("E".equals(RTYPE)) {
throw new BadRequestException(result.getString("RTMSG"));
}
} catch (Exception e) {
throw new BadRequestException("飞书提示错误:" + e.getMessage());
}
return result;
}
@Override @Override
public JSONObject momAutoTransterMoveIn(JSONObject param){ return null;} /*{ public JSONObject momAutoTransterMoveIn(JSONObject param){ return null;} /*{
String from_area = param.getString("from_area"); String from_area = param.getString("from_area");