<p class="form-pider"></p> <p class="form-item form-remark"> <p class="item-title"><span class="adError">*</span> 投放产品</p> <input name="app" ng-model="chance.appName" type="text" class="item-select" placeholder="请填写产品名称"> </p> <p ng-if="ishaveName==true" class="margin-top-1 adError"> 该应用已被商务"{{haveName}}"录入国,可保持沟通 </p>
$scope.chance={ appName:null};
$scope.chance={ appName:null};$scope.ishaveName= false;
$scope.$watch('chance.appName',function () { $scope.ishaveName= false; if($scope.chance.appName!=null&&$scope.chance.appName!=undefined&&$scope.chance.appName!=''){ $http.get(ctx+'/chance/findAdminByAppName?appName='+$scope.chance.appName) .success(function (data,status) { if(data.result!=null){ $scope.haveName= data.result.name; $scope.ishaveName= true; } }) } });
@Controller@RequestMapping("chance")@ResourceFolder(folder = "module/chance/")public class ChanceController { @GetMapping("findAdminByAppName") @ResponseBody public ResponseBean findAdminByAppName(String appName){ try { return ResponseBean.buildSuccess(customerChanceService.findAdminByAppName(appName)); }catch (AppException e){ return ResponseBean.buildFailure(e.getMessage()); } } }
//根据产品名字 ,查看是否有商务经理已经添加了该产品,选则一个不是自己的产品经理@Overridepublic SysAdminUser findAdminByAppName(String appName) { if("".equals(appName)||appName==null){ return null; } Long adminId = CasConfig.RemoteUserUtil.getRemoteUserId(); List<SysAdminUser> sysAdminUsers = customerMapper.findAdminByAppName(appName); //有可能会出现多个人,那么首先如果是自己创建的话,就排除掉 if(sysAdminUsers.size()>0){ if(adminId.compareTo(sysAdminUsers.get(0).getId())==0){ sysAdminUsers.remove(0); } if(sysAdminUsers.size()>0){ return sysAdminUsers.get(0); } } return null; }
<!--根据产品,名字,看出是否已经有商务经理在维护了,根据产品名字 ,查看是否有商务经理已经添加了该产品,如果前台传入的参数我空,则通过java判断,不能进入本sql,`否则会出错`--> <select id="findAdminByAppName" resultType="com.duodian.admore.entity.db.admin.SysAdminUser"> SELECT s.* FROM `sys_admin_user` s left JOIN crm_customer_chance c on c.adminId = s.id where c.isVisible = 1 and c.adminId is not NULL <if test="_parameter != null and _parameter!= ''"> and c.appName = #{_parameter} </if> GROUP by id </select> </mapper>
相關推薦:
以上是AngularJs watch監聽input value並請求資料的方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!