/**
  * @Title: editSuppliers @Description: TODO(这修改供应商来源信息信息)
  *
  * @param @param Suppliers
  * @param @return 设定文件
  * @return Object 返回类型
  * @throws
  */
 @Transactional(readOnly = false)
 @MethodLog(opera = "SuppliersSourceList_edit")
 public Object editSuppliersSource(ParSuppliersSource suppliersSource) {
   Subject pricipalSubject = SecurityUtils.getSubject();
   User pricipalUser = (User) pricipalSubject.getPrincipal();
   JqReturnJson returnResult = new JqReturnJson(); // 构建返回结果,默认结果为false
   ParSuppliersSourceExample suppliersSourceExample = new ParSuppliersSourceExample();
   int count = 0;
   // 防止名称重复
   suppliersSourceExample
       .createCriteria()
       .andSourceNameEqualTo(suppliersSource.getSourceName())
       .andSourceIdNotEqualTo(suppliersSource.getSourceId());
   count = suppliersSourceMapper.countByExample(suppliersSourceExample);
   if (count > 0) {
     returnResult.setMsg("供应商来源信息名称重复");
     returnResult.setSuccess(false);
     return returnResult;
   }
   suppliersSource.setUpdater(pricipalUser.getUserCnName());
   suppliersSource.setUpdateTime(new Date());
   count = suppliersSourceMapper.updateByPrimaryKeySelective(suppliersSource);
   if (count == 1) {
     returnResult.setSuccess(true);
     returnResult.setMsg("信息已保存");
   } else {
     returnResult.setMsg("发生未知错误,信息保存失败");
   }
   return returnResult;
 }
 /**
  * @Title: delCarType @Description: TODO(删除供应商来源信息信息)
  *
  * @param @param SuppliersIds
  * @param @param parCompanyNames
  * @param @return 设定文件
  * @return Object 返回类型
  * @throws
  */
 @Transactional(readOnly = false)
 @MethodLog(opera = "SuppliersSourceList_del")
 public Object delSuppliersSource(List<String> suppliersSourceIds, List<String> names) {
   JqReturnJson returnResult = new JqReturnJson(); // 构建返回结果,默认结果为false
   int count = 0;
   if (suppliersSourceIds.size() > 0) {
     ParSuppliersSourceExample suppliersExample = new ParSuppliersSourceExample();
     suppliersExample.createCriteria().andSourceIdIn(suppliersSourceIds);
     count = suppliersSourceMapper.deleteByExample(suppliersExample);
     if (count > 0) {
       returnResult.setSuccess(true);
       returnResult.setMsg(
           "成功删除了供应商来源信息为:[ " + CollectionsUtil.convertToString(names, ",") + " ]的信息");
     } else {
       returnResult.setMsg("发生未知错误,信息删除失败");
     }
   }
   return returnResult;
 }
 /**
  * @Title: listAsGrid @Description: TODO(获取所有供应商来源信息信息)
  *
  * @param @param optgroupId
  * @param @param pager
  * @param @return 设定文件
  * @return Object 返回类型
  * @throws
  */
 public Object listAsGrid(JqPager jqPager, ParSuppliersSourceQueryDTO suppliersQueryDTO) {
   JqGridReturn returnResult = new JqGridReturn();
   ParSuppliersSourceExample suppliersSourceExample = new ParSuppliersSourceExample();
   Criteria queryCriteria = suppliersSourceExample.createCriteria();
   suppliersQueryDTO.setQueryCondition(queryCriteria);
   if (null != jqPager.getPage() && null != jqPager.getRows()) { // 设置排序信息
     suppliersSourceExample.setLimitStart((jqPager.getPage() - 1) * jqPager.getRows());
     suppliersSourceExample.setLimitEnd(jqPager.getRows());
   }
   if (StringUtils.isNotBlank(jqPager.getSort())
       && StringUtils.isNotBlank(jqPager.getOrder())) { // 设置排序信息
     suppliersSourceExample.setOrderByClause(jqPager.getOrderBy("temp_par_suppliers_source_"));
   }
   List<ParSuppliersSource> carrierCarTypeList =
       suppliersSourceMapper.selectByExample(suppliersSourceExample); // 查询所有列表
   int total = suppliersSourceMapper.countByExample(suppliersSourceExample); // 查询总页数
   returnResult.setRows(carrierCarTypeList);
   returnResult.setTotal(total);
   return returnResult; // 返回ExtGrid表
 }
 /**
  * @Title: getSuppliersSourceCombo @Description: TODO(供应商类型下拉项显示)
  *
  * @param @return 设定文件
  * @return Object 返回类型
  * @throws
  */
 public Object getSuppliersSourceCombo() {
   ParSuppliersSourceExample suppliersSourceExample = new ParSuppliersSourceExample();
   suppliersSourceExample.createCriteria().andEnabledEqualTo("enable");
   return JackJson.fromObjectToJson(suppliersSourceMapper.selectByExample(suppliersSourceExample));
 }