Exemplo n.º 1
0
 /**
  * 新增样品
  *
  * @return
  */
 public String addSampleAction() {
   try {
     this.clearMessages();
     // 数据验证
     if (!checkData(addSampleDto)) {
       return "checkerror";
     }
     // 当前操作用户ID
     String username =
         (String) ActionContext.getContext().getSession().get(Constants.SESSION_USER_ID);
     addSampleDto.setUpdateuid(username);
     addSampleDto.setCreateuid(username);
     addSampleDto.setRank(Constants.ROLE_RANK_OPERATOR);
     addSampleDto.setWarehousename(
         PropertiesConfig.getPropertiesValueByKey(Constants.SYSTEM_WAREHOUSE_NAME));
     addSampleDto.setBelongto(PropertiesConfig.getPropertiesValueByKey(Constants.SYSTEM_BELONG));
     // 默认状态=有效
     addSampleDto.setStatus(Constants.STATUS_NORMAL);
     sampleService.insertSample(addSampleDto);
     this.addActionMessage("添加成功!");
     addSampleDto = new SampleDto();
   } catch (Exception e) {
     log.error("addSampleAction error:" + e);
     return ERROR;
   }
   return SUCCESS;
 }
Exemplo n.º 2
0
 /** 初期化字典数据 */
 private void initDictList() {
   // 采购主题
   goodsList =
       dict01Service.queryDict01ByFieldcode(
           Constants.DICT_GOODS_TYPE,
           PropertiesConfig.getPropertiesValueByKey(Constants.SYSTEM_LANGUAGE));
   // 单位
   unitList =
       dict01Service.queryDict01ByFieldcode(
           Constants.DICT_UNIT_TYPE,
           PropertiesConfig.getPropertiesValueByKey(Constants.SYSTEM_LANGUAGE));
   // 产地
   makeareaList =
       dict01Service.queryDict01ByFieldcode(
           Constants.DICT_MAKEAREA,
           PropertiesConfig.getPropertiesValueByKey(Constants.SYSTEM_LANGUAGE));
   // 颜色
   colorList =
       dict01Service.queryDict01ByFieldcode(
           Constants.DICT_COLOR_TYPE,
           PropertiesConfig.getPropertiesValueByKey(Constants.SYSTEM_LANGUAGE));
 }