|
|
@@ -512,4 +512,45 @@ public class WxController extends ApiBaseController {
|
|
|
return AjaxResult.success(JSON.parseObject(qyWxUserUtil.getJsApiTicket(url, agent)));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "自提收货通知",
|
|
|
+ notes = "" )
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "params" , paramType = "body")
|
|
|
+ })
|
|
|
+ @PostMapping("sendSelfTMSMessage")
|
|
|
+ public Object sendSelfTMSMessage() {
|
|
|
+
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
+ obj.checkParameterNotNull("chain,order");
|
|
|
+ String chain = obj.getString("chain");
|
|
|
+ String order = obj.getString("order");
|
|
|
+ String temple = configService.selectConfigByKey("wx.notification.tms.self");
|
|
|
+
|
|
|
+
|
|
|
+ String templeDetail = configService.selectConfigByKey("wx.notification.order.detail");
|
|
|
+
|
|
|
+
|
|
|
+ String orderFormat = null;
|
|
|
+ String[] orderArrays = order.split(",");
|
|
|
+ String customerName = sysUserService.getCustomNameByCode(chain);
|
|
|
+ List<String> strList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < orderArrays.length; i++) {
|
|
|
+ String orderStr = orderArrays[i];
|
|
|
+ String messageDetail = String.format(templeDetail, orderStr, customerName, orderStr);
|
|
|
+ strList.add(messageDetail);
|
|
|
+ }
|
|
|
+ orderFormat = strList.stream().collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ String message = String.format(temple, orderFormat, chain);
|
|
|
+ Set<String> customerCodes = new HashSet<>();
|
|
|
+ customerCodes.add(chain);
|
|
|
+ logger.info("收到需要通知的经销商组织代码:"+chain);
|
|
|
+ Map<String,Map<String,Object>> maps = sysUserService.selectLoginNamesByCostumerCode(customerCodes);
|
|
|
+ //消息
|
|
|
+ if(customerCodes.size()>0){
|
|
|
+ qyWxSendMessageUtil.sendMsgToCustomer(customerCodes,maps,message, "14");
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
}
|