master
kira 6 years ago
parent 016f5f94b1
commit 5c19193c78

@ -422,6 +422,7 @@ public class RetailAppServiceImp implements RetailAppService {
return customerServiceService.checkAndSave(account); return customerServiceService.checkAndSave(account);
} }
//暂不使用
@Override @Override
public void addUnreadMsg(JSONObject device, JSONObject param) { public void addUnreadMsg(JSONObject device, JSONObject param) {
customerServiceService.addUnreadMsg(param); customerServiceService.addUnreadMsg(param);

@ -549,9 +549,4 @@ public class RetailAppController {
return retailAppService.openimCheck(device); return retailAppService.openimCheck(device);
} }
@RequestMapping(value = "/openim/chat",method = RequestMethod.POST)
public void openimChat(@ModelAttribute(RETAIL_DEVICE) JSONObject device,@RequestBody JSONObject param) {
retailAppService.addUnreadMsg(device,param);
}
} }

@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
@ -57,9 +58,10 @@ public class OpenimController {
return customerServiceService.query(clientMoniker,userNames); return customerServiceService.query(clientMoniker,userNames);
} }
@ManagerMapping(value = "/servant/onoff", method = RequestMethod.PUT,role = {ManagerRole.ADMIN}) @ManagerMapping(value = "/servant/{manager_id}/onoff", method = RequestMethod.PUT,role = {ManagerRole.ADMIN})
public void listServants(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager, @RequestBody JSONObject param) { public void listServants(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager,@PathVariable String manager_id, @RequestBody JSONObject param) {
customerServiceService.onoff(loginManager,param.getBoolean("onoff")); param.put("manager_id",manager_id);
customerServiceService.onoff(param);
} }
} }

@ -18,7 +18,7 @@ public interface CustomerServiceService {
List<JSONObject> query(String clientMoniker,String userNames); List<JSONObject> query(String clientMoniker,String userNames);
void onoff(JSONObject manager,boolean status); void onoff(JSONObject param);
void addUnreadMsg(JSONObject params); void addUnreadMsg(JSONObject params);

@ -141,10 +141,10 @@ public class CustomerServiceServiceImpl implements CustomerServiceService {
} }
@Override @Override
public void onoff(JSONObject manager, boolean onoff) { public void onoff(JSONObject manager) {
JSONObject record = new JSONObject(); JSONObject record = new JSONObject();
record.put("manager_id", manager.getString("manager_id")); record.put("manager_id", manager.getString("manager_id"));
record.put("onoff", onoff); record.put("onoff", manager.getBoolean("onoff"));
udpateOrSave(record); udpateOrSave(record);
} }

@ -9,6 +9,7 @@ import javax.annotation.Resource;
/** /**
* Created by wangning on 2018/1/2. * Created by wangning on 2018/1/2.
*
*/ */
@Component @Component
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") @ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
@ -17,7 +18,8 @@ public class SendUnreadMsgWechatTask {
private CustomerServiceService customerServiceService; private CustomerServiceService customerServiceService;
// @Scheduled(cron = "0 0/10 * * * ?") // @Scheduled(cron = "0 0/10 * * * ?")
public void ofeiOrderCheck() { // public void ofeiOrderCheck() {
customerServiceService.sendUnreadWxMsg(); // customerServiceService.sendUnreadWxMsg();
} // }
} }

@ -97,7 +97,7 @@
<select id="listServants" resultType="com.alibaba.fastjson.JSONObject"> <select id="listServants" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT display_name SELECT display_name,manager_id
FROM sys_managers FROM sys_managers
WHERE role & #{mask} >0 AND (org_id IS NULL or org_id=1) AND is_valid = 1 WHERE role & #{mask} >0 AND (org_id IS NULL or org_id=1) AND is_valid = 1
]]> ]]>

@ -75,7 +75,7 @@ define(['angular', 'uiRouter'], function (angular) {
$scope.loadServants(); $scope.loadServants();
$scope.onoff = function (servant) { $scope.onoff = function (servant) {
var param = {onoff:servant.onoff}; var param = {onoff:servant.onoff};
$http.put('/sys/openim/servant/onoff',param).then(function (resp) { $http.put('/sys/openim/servant/'+servant.manager_id+'/onoff',param).then(function (resp) {
},function (resp) { },function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
}); });

Loading…
Cancel
Save