import com.yd.common.data.CIPPageInfo;
import com.yd.common.data.CIPReqCondition;
import com.yd.common.exception.CIPDaoException;
import com.yd.common.runtime.CIPErrorCode;
import com.yd.wms.busi.dao.impl.WMS_busi_outboundDaoImpl;
import com.yd.wms.busi.data.WMS_busi_outboundData;
import com.yd.wms.busi.data.po.WMS_busi_outboundPO; import java.util.List;
import java.util.Map; import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Repository; public int addData(WMS_busi_outboundPO po) {
SimpleJdbcInsert insertActor = new SimpleJdbcInsert(jdbcTemplate).withTableName("riv_outbound_notice_h").usingGeneratedKeyColumns("ONH_ID");
try{
KeyHolder keyHolder = insertActor.executeAndReturnKeyHolder(new BeanPropertySqlParameterSource(po));
return keyHolder.getKey().intValue();
}catch(Exception e) {
log.error(e);
throw new CIPDaoException(CIPErrorCode.ERROR_DATABASE_TECH_EXCEPTION);
}
}
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder; KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.getJdbcOperations().update(new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
PreparedStatement ps = con.prepareStatement(OmsSqlConstants.SAVE_MATERIAL_FOR_QM, new String[] {"mat_id"});
ps.setString(1, materialProxy.getRivMaterial().getMatCode());
ps.setInt(2, materialProxy.getRivMaterial().getMatOwnerId());
ps.setString(3, materialProxy.getRivMaterial().getMatName());
ps.setString(4, materialProxy.getRivMaterial().getMatShortName());
ps.setString(5, materialProxy.getRivMaterial().getMatEnName());
ps.setString(6, materialProxy.getRivMaterial().getMatSpec());
ps.setString(7, materialProxy.getRivMaterial().getMatBarcode());
ps.setString(8, materialProxy.getRivMaterial().getMatBasicUomName());
ps.setBigDecimal(9, materialProxy.getRivMaterial().getMatShelfLifeDays());
ps.setInt(10, materialProxy.getRivMaterial().getMatIsFragile());
ps.setInt(11, materialProxy.getRivMaterial().getStatus());
ps.setTimestamp(12, new Timestamp(System.currentTimeMillis()));
ps.setInt(13, SecurityContextHelper.getCurrentUserId());
ps.setString(14, materialProxy.getRivMaterial().getMatInternalBarcode());
ps.setString(15, materialProxy.getRivMaterial().getGenMethod());
ps.setInt(16, SecurityContextHelper.getCurrentUserId());
ps.setString(17, materialProxy.getRivMaterial().getMatSkc());
return ps;
}
}, keyHolder); /** 物料表记录保存 **/
public final static String SAVE_MATERIAL_FOR_QM = "insert into riv_material \n" +
" (mat_code, mat_owner_id, mat_name, mat_short_name, mat_en_name, mat_spec, \n" +
" mat_barcode, mat_basic_uom_name, mat_shelf_life_days, mat_is_fragile, status, create_time, \n" +
" create_user_id, MAT_INTERNAL_BARCODE, GEN_METHOD, update_user_id,mat_skc) " +
" values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?) ";

最新文章

  1. 百度推出新技术 MIP,网页加载更快,广告呢?
  2. jQuery动态产生的铵钮怎样实现事件处理
  3. opencv实现图片缩放
  4. 元素设置position:fixed属性后IE下宽度无法100%延伸
  5. Linux 修改计算机名
  6. editActionsForRowAtIndexPath(iOS8) tableview编辑(删除、插入、移动)
  7. 使用gulp在开发过程中合理导出zip文件
  8. 使vim中Syntastic支持C++11
  9. HTTP 协议实现
  10. Sigmoid function in NN
  11. Ajax XMLHttpRequest对象的三个属性以及open和send方法
  12. CSS3实现时间轴效果
  13. Eclipse PHP 代码无法自动提示函数
  14. 将字符串向hdfs中写入,出现中文乱码!
  15. [Ramda] Lens in Depth
  16. Tensorflow serving with Kubernetes
  17. Golang操作结构体、Map转化为JSON
  18. linux查看系统的硬件信息【转】
  19. CSS reset--(来自网易)
  20. pip通过requirements.txt安装依赖

热门文章

  1. 发布django 程序
  2. Scala总结
  3. stm32与三菱PLC通信
  4. linux命令-tar工具详解
  5. Ok6410裸机驱动学习(一)开发工具
  6. 实现reentrantlock和读写锁
  7. [matlab]一道笔试题
  8. 转:基于InfluxDB&Grafana的JMeter实时性能测试数据的监控和展示
  9. latex 输入矩阵
  10. Linux 最小系统挂载U盘(SD、TF卡)并执行程序