fix: 药品实时库存,代码提交。
This commit is contained in:
@@ -1,30 +1,23 @@
|
|||||||
package com.ruoyi.health.controller;
|
package com.ruoyi.health.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||||
import java.io.IOException;
|
import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
import javax.annotation.Resource;
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.log.annotation.Log;
|
import com.ruoyi.common.log.annotation.Log;
|
||||||
import com.ruoyi.common.log.enums.BusinessType;
|
import com.ruoyi.common.log.enums.BusinessType;
|
||||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||||
import com.ruoyi.health.domain.HealthMedicineStockIn;
|
import com.ruoyi.health.domain.HealthMedicineStockIn;
|
||||||
import com.ruoyi.health.domain.vo.HealthMedicineStockInVo;
|
|
||||||
import com.ruoyi.health.domain.dto.HealthMedicineStockInDto;
|
import com.ruoyi.health.domain.dto.HealthMedicineStockInDto;
|
||||||
|
import com.ruoyi.health.domain.vo.HealthMedicineStockInVo;
|
||||||
import com.ruoyi.health.service.IHealthMedicineStockInService;
|
import com.ruoyi.health.service.IHealthMedicineStockInService;
|
||||||
import com.ruoyi.common.core.web.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品入库清单Controller
|
* 药品入库清单Controller
|
||||||
@@ -113,4 +106,17 @@ public class HealthMedicineStockInController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(healthMedicineStockInService.deleteHealthMedicineStockInByIds(ids));
|
return toAjax(healthMedicineStockInService.deleteHealthMedicineStockInByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询药品实时库存列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value="查询药品实时库存列表",response = HealthMedicineStockInVo.class)
|
||||||
|
@RequiresPermissions("health:medicineStockIn:list")
|
||||||
|
@GetMapping("/realTimeList")
|
||||||
|
public TableDataInfo realTimeList(HealthMedicineStockInDto healthMedicineStockInDto)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<HealthMedicineStockInVo> list = healthMedicineStockInService.selectHealthMedicineRealtimeList(healthMedicineStockInDto);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.ruoyi.health.mapper;
|
package com.ruoyi.health.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.health.domain.HealthMedicineStockIn;
|
import com.ruoyi.health.domain.HealthMedicineStockIn;
|
||||||
import com.ruoyi.health.domain.dto.HealthMedicineStockInDto;
|
import com.ruoyi.health.domain.dto.HealthMedicineStockInDto;
|
||||||
import com.ruoyi.health.domain.vo.HealthMedicineStockInVo;
|
import com.ruoyi.health.domain.vo.HealthMedicineStockInVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品入库清单Mapper接口
|
* 药品入库清单Mapper接口
|
||||||
*
|
*
|
||||||
@@ -76,4 +77,14 @@ public interface HealthMedicineStockInMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int removeHealthMedicineStockInByIds(Long[] ids);
|
public int removeHealthMedicineStockInByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询药品实时库存列表
|
||||||
|
*
|
||||||
|
* @param healthMedicineStockInDto 药品入库清单
|
||||||
|
* @return 药品入库清单集合
|
||||||
|
*/
|
||||||
|
public List<HealthMedicineStockInVo> selectHealthMedicineRealtimeList(HealthMedicineStockInDto healthMedicineStockInDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.ruoyi.health.service;
|
package com.ruoyi.health.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.health.domain.HealthMedicineStockIn;
|
import com.ruoyi.health.domain.HealthMedicineStockIn;
|
||||||
import com.ruoyi.health.domain.dto.HealthMedicineStockInDto;
|
import com.ruoyi.health.domain.dto.HealthMedicineStockInDto;
|
||||||
import com.ruoyi.health.domain.vo.HealthMedicineStockInVo;
|
import com.ruoyi.health.domain.vo.HealthMedicineStockInVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品入库清单Service接口
|
* 药品入库清单Service接口
|
||||||
*
|
*
|
||||||
@@ -60,4 +61,13 @@ public interface IHealthMedicineStockInService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteHealthMedicineStockInById(Long id);
|
public int deleteHealthMedicineStockInById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询药品实时库存列表
|
||||||
|
*
|
||||||
|
* @param healthMedicineStockInDto 药品入库清单
|
||||||
|
* @return 药品入库清单集合
|
||||||
|
*/
|
||||||
|
public List<HealthMedicineStockInVo> selectHealthMedicineRealtimeList(HealthMedicineStockInDto healthMedicineStockInDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,4 +101,16 @@ public class HealthMedicineStockInServiceImpl implements IHealthMedicineStockInS
|
|||||||
{
|
{
|
||||||
return healthMedicineStockInMapper.removeHealthMedicineStockInById(id);
|
return healthMedicineStockInMapper.removeHealthMedicineStockInById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询药品实时库存列表
|
||||||
|
*
|
||||||
|
* @param healthMedicineStockInDto 药品入库清单
|
||||||
|
* @return 药品入库清单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<HealthMedicineStockInVo> selectHealthMedicineRealtimeList(HealthMedicineStockInDto healthMedicineStockInDto)
|
||||||
|
{
|
||||||
|
return healthMedicineStockInMapper.selectHealthMedicineRealtimeList(healthMedicineStockInDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<sql id="selectHealthMarRecordVo">
|
<sql id="selectHealthMarRecordVo">
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
a.name,
|
|
||||||
a.type,
|
a.type,
|
||||||
a.create_by,
|
a.create_by,
|
||||||
a.create_time,
|
a.create_time,
|
||||||
@@ -53,13 +52,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.content,
|
a.content,
|
||||||
a.content_unit,
|
a.content_unit,
|
||||||
hp."name" as person_name ,
|
hp."name" as person_name ,
|
||||||
hr."name" as health_record_name
|
hr."name" as health_record_name,
|
||||||
|
hmb.short_name || '-' || hmb.brand || '(' || hmb.packaging || ')' as name
|
||||||
from
|
from
|
||||||
health_mar_record a
|
health_mar_record a
|
||||||
left join health_person hp on
|
left join health_person hp on
|
||||||
hp.id = a.person_id
|
hp.id = a.person_id
|
||||||
left join health_record hr on
|
left join health_record hr on
|
||||||
hr.id = a.health_record_id
|
hr.id = a.health_record_id
|
||||||
|
left join health_medicine_basic hmb on
|
||||||
|
hmb.id = a.medicine_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectHealthMarRecordList" parameterType="HealthMarRecordDto" resultMap="HealthMarRecordResult">
|
<select id="selectHealthMarRecordList" parameterType="HealthMarRecordDto" resultMap="HealthMarRecordResult">
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.purchase_address,
|
a.purchase_address,
|
||||||
a.unit,
|
a.unit,
|
||||||
a.total_price,
|
a.total_price,
|
||||||
hmb."name" as medicine_name,
|
hmb.short_name || '-' || hmb.brand || '(' || hmb.packaging || ')' as medicine_name,
|
||||||
a.package_unit,
|
a.package_unit,
|
||||||
a.total_count
|
a.total_count
|
||||||
from
|
from
|
||||||
@@ -173,7 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="ageWeight != null">age_weight = #{ageWeight},</if>
|
<if test="ageWeight != null">age_weight = #{ageWeight},</if>
|
||||||
<if test="unit != null">unit = #{unit},</if>
|
<if test="unit != null">unit = #{unit},</if>
|
||||||
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
|
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
|
||||||
<if test="totalCount != null">total_count = #{packageUnit},</if>
|
<if test="totalCount != null">total_count = #{totalCount},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@@ -198,4 +198,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectHealthMedicineRealtimeList" parameterType="HealthMedicineStockInDto" resultMap="HealthMedicineStockInResult">
|
||||||
|
select
|
||||||
|
a.medicine_id,
|
||||||
|
sum(a.left_count) as left_count,
|
||||||
|
sum(a.total_count) as total_count,
|
||||||
|
a.unit,
|
||||||
|
hmb.short_name || '-' || hmb.brand || '(' || hmb.packaging || ')' as medicine_name
|
||||||
|
from
|
||||||
|
health_medicine_stock_in a
|
||||||
|
left join health_medicine_basic hmb on
|
||||||
|
hmb.id = a.medicine_id
|
||||||
|
|
||||||
|
<where>
|
||||||
|
a.del_flag='0'
|
||||||
|
and a.left_count>0
|
||||||
|
<if test="medicineId != null "> and a.medicine_id = #{medicineId}</if>
|
||||||
|
</where>
|
||||||
|
<!-- 数据范围过滤 -->
|
||||||
|
${params.dataScope}
|
||||||
|
group by
|
||||||
|
a.medicine_id,
|
||||||
|
a.left_count,
|
||||||
|
a.unit,
|
||||||
|
hmb.short_name,
|
||||||
|
a.package_unit,
|
||||||
|
hmb.brand,
|
||||||
|
hmb.packaging,
|
||||||
|
a.total_count
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user