IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发测试 -> 医院耗材管理系统开发_3 -> 正文阅读

[开发测试]医院耗材管理系统开发_3

该文总结近期功能实现:

科室库出库:接受前端传入数据后,根据数量完成stock与stock_detail库的修改。

接收数据,调用outFromBranch方法

@ApiOperation("移出科室库")
@RequestMapping(value = "/outFromBranch", method = RequestMethod.POST)
@ResponseBody
public CommonResult outFromBranch(@RequestBody ReagentStock stock) {

    int count = stockService.outFromBranch(stock);

    return CommonResult.success(1);
}

改变quantuty,调用updateByPrimaryKeySelective并传入

public int outFromBranch(ReagentStock stock){
    long Quantity=stock.getQuantity();
    long Number=stock.getoutNumber();
    stock.setQuantity(Quantity-Number);
    stockMapper.updateByPrimaryKeySelective(stock);
    return stockMapper.outFromBranch(stock.getStockNo(),Number);

}

调用数据库并写入(需判断if,否则容易出问题)

<update id="updateByExampleSelective" parameterType="map">
update reagent_stock
<set>
  <if test="record.id != null">
    id = #{record.id,jdbcType=BIGINT},
  </if>
  <if test="record.stockNo != null">
    stock_no = #{record.stockNo,jdbcType=VARCHAR},
  </if>
  <if test="record.stockType != null">
    stock_type = #{record.stockType,jdbcType=VARCHAR},
  </if>
  <if test="record.reagentId != null">
    reagent_id = #{record.reagentId,jdbcType=VARCHAR},
  </if>
  <if test="record.reagentName != null">
    reagent_name = #{record.reagentName,jdbcType=VARCHAR},
  </if>
  <if test="record.reagentType != null">
    reagent_type = #{record.reagentType,jdbcType=VARCHAR},
  </if>
  <if test="record.reagentUnit != null">
    reagent_unit = #{record.reagentUnit,jdbcType=VARCHAR},
  </if>
  <if test="record.branchName != null">
    branch_name = #{record.branchName,jdbcType=VARCHAR},
  </if>
  <if test="record.factory != null">
    factory = #{record.factory,jdbcType=VARCHAR},
  </if>
  <if test="record.supplierName != null">
    supplier_name = #{record.supplierName,jdbcType=VARCHAR},
  </if>
  <if test="record.quantity != null">
    quantity = #{record.quantity,jdbcType=BIGINT},
  </if>
  <if test="record.reagentPrice != null">
    reagent_price = #{record.reagentPrice,jdbcType=DOUBLE},
  </if>
  <if test="record.reagentStatus != null">
    reagent_status = #{record.reagentStatus,jdbcType=VARCHAR},
  </if>
  <if test="record.reagentTemp != null">
    reagent_temp = #{record.reagentTemp,jdbcType=VARCHAR},
  </if>
  <if test="record.lowStock != null">
    low_stock = #{record.lowStock,jdbcType=VARCHAR},
  </if>
  <if test="record.overdueStock != null">
    overdue_stock = #{record.overdueStock,jdbcType=INTEGER},
  </if>
  <if test="record.overdue != null">
    overdue = #{record.overdue,jdbcType=INTEGER},
  </if>
  <if test="record.createTime != null">
    create_time = #{record.createTime,jdbcType=TIMESTAMP},
  </if>
  <if test="record.createBy != null">
    create_by = #{record.createBy,jdbcType=VARCHAR},
  </if>
  <if test="record.updateTime != null">
    update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  </if>
  <if test="record.updateBy != null">
    update_by = #{record.updateBy,jdbcType=VARCHAR},
  </if>
  <if test="record.deleteFlag != null">
    delete_flag = #{record.deleteFlag,jdbcType=TINYINT},
  </if>
  <if test="record.deleteTime != null">
    delete_time = #{record.deleteTime,jdbcType=TIMESTAMP},
  </if>
  <if test="record.deleteBy != null">
    delete_by = #{record.deleteBy,jdbcType=VARCHAR},
  </if>
</set>
<if test="_parameter != null">
  <include refid="Update_By_Example_Where_Clause" />
</if>
以上完成stock库-1

调用outFromBranch

<delete id="outFromBranch" parameterType="jp.co.nss.hrm.backend.model.ReagentStock">
delete from reagent_stock_detail
where stock_no = ${stock_no}
limit ${Number}

完成detail库操作,根据数量删除

  开发测试 最新文章
pytest系列——allure之生成测试报告(Wind
某大厂软件测试岗一面笔试题+二面问答题面试
iperf 学习笔记
关于Python中使用selenium八大定位方法
【软件测试】为什么提升不了?8年测试总结再
软件测试复习
PHP笔记-Smarty模板引擎的使用
C++Test使用入门
【Java】单元测试
Net core 3.x 获取客户端地址
上一篇文章      下一篇文章      查看所有文章
加:2022-04-26 12:07:07  更:2022-04-26 12:07:55 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/19 5:06:51-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码