/**
  * @Title: editParClientLevel @Description: TODO(修改客户等级信息)
  *
  * @param @param parClientLevel
  * @param @return 设定文件
  * @return Object 返回类型
  * @throws
  */
 @Transactional(readOnly = false)
 @MethodLog(opera = "ClientLevelList_edit")
 public Object editParClientLevel(ParClientLevel parClientLevel) {
   Subject pricipalSubject = SecurityUtils.getSubject();
   User pricipalUser = (User) pricipalSubject.getPrincipal();
   JqReturnJson returnResult = new JqReturnJson(); // 构建返回结果,默认结果为false
   ParClientLevelExample parClientLevelExample = new ParClientLevelExample();
   int count = 0;
   // 防止客户等级名称重复
   parClientLevelExample
       .createCriteria()
       .andClientLevelNameEqualTo(parClientLevel.getClientLevelName())
       .andClientLevelIdNotEqualTo(parClientLevel.getClientLevelId());
   count = parClientLevelMapper.countByExample(parClientLevelExample);
   if (count > 0) {
     returnResult.setMsg("客户等级名称重复");
     return returnResult;
   }
   // 更新更新人和更新时间
   parClientLevel.setUpdater(pricipalUser.getUserCnName());
   parClientLevel.setUpdateTime(new Date());
   count = parClientLevelMapper.updateByPrimaryKeySelective(parClientLevel);
   if (count == 1) {
     returnResult.setSuccess(true);
     returnResult.setMsg("[" + parClientLevel.getClientLevelName() + "] 客户等级信息已保存");
   } else {
     returnResult.setMsg("发生未知错误,客户等级信息保存失败");
   }
   return returnResult;
 }
 /**
  * @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;
 }
示例#3
0
 /**
  * @Title: editGoodsList @Description: TODO(修改货物档案信息)
  *
  * @param @param suppliersIndustry
  * @param @return 设定文件
  * @return Object 返回类型
  * @throws
  */
 @Transactional(readOnly = false)
 @MethodLog(opera = "GoodsList_edit")
 public Object editGoodsList(GoodsList goodsList) {
   Subject pricipalSubject = SecurityUtils.getSubject();
   User pricipalUser = (User) pricipalSubject.getPrincipal();
   JqReturnJson returnResult = new JqReturnJson(); // 构建返回结果,默认结果为false
   int count = 0;
   goodsList.setUpdater(pricipalUser.getUserCnName());
   goodsList.setUpdateTime(new Date());
   count = goodsListMapper.updateByPrimaryKeySelective(goodsList);
   if (count == 1) {
     returnResult.setSuccess(true);
     returnResult.setMsg("【" + goodsList.getGoodsName() + "】货物档案信息已保存");
   } else {
     returnResult.setMsg("发生未知错误,货物档案信息保存失败");
   }
   return returnResult;
 }
示例#4
0
 /**
  * @Title: addGoodsList @Description: TODO(新增货物档案信息)
  *
  * @param @param suppliersGrade
  * @param @return 设定文件
  * @return Object 返回类型
  * @throws
  */
 @Transactional(readOnly = false)
 @MethodLog(opera = "GoodsList_add")
 public Object addGoodsList(GoodsList goodsList) {
   Subject pricipalSubject = SecurityUtils.getSubject();
   User pricipalUser = (User) pricipalSubject.getPrincipal();
   JqReturnJson returnResult = new JqReturnJson(); // 构建返回结果,默认结果为false
   GoodsListExample goodsListExample = new GoodsListExample();
   int count = 0;
   // 防止货物档案名称重复
   goodsListExample.createCriteria().andGoodsNameEqualTo(goodsList.getGoodsName());
   count = goodsListMapper.countByExample(goodsListExample);
   if (count > 0) {
     returnResult.setMsg("货物档案信息重复,请重新填写!");
     returnResult.setSuccess(false);
     return returnResult;
   }
   // 随机号生成
   SimpleDateFormat SF = new SimpleDateFormat("yyyy-MM-DD-HHmmss");
   goodsList.setGoodsId(RandomGUID.getRandomGUID());
   goodsList.setGoodsCode("GD_" + SF.format(new Date()));
   goodsList.setSpecification("SP_" + SF.format(new Date()));
   goodsList.setAuditor("超级管理员");
   goodsList.setAuditState("pass");
   goodsList.setAuditTime(new Date());
   goodsList.setEnabled("enable");
   goodsList.setGoodsTypeId(goodsList.getGoodsSortId());
   goodsList.setCreater(pricipalUser.getUserCnName());
   goodsList.setCreateTime(new Date());
   goodsList.setUpdater(pricipalUser.getUserCnName());
   goodsList.setUpdateTime(new Date());
   count = goodsListMapper.insert(goodsList);
   if (count == 1) {
     returnResult.setSuccess(true);
     returnResult.setMsg("【" + goodsList.getGoodsName() + "】 货物档案信息信息已保存");
   } else {
     returnResult.setMsg("发生未知错误,货物档案信息保存失败");
   }
   return returnResult;
 }