Commit c8fe83a9 by zhu.zewen

修复药品专用登记相关专账

修复专账详情筛选
新增专账日结和月结
parent 09ea606e
...@@ -3,6 +3,7 @@ package com.jmai; ...@@ -3,6 +3,7 @@ package com.jmai;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.scheduling.annotation.EnableScheduling;
...@@ -15,6 +16,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder; ...@@ -15,6 +16,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
@SpringBootApplication(scanBasePackages = { @SpringBootApplication(scanBasePackages = {
"com.jmai" "com.jmai"
}) })
@EnableScheduling
public class Application { public class Application {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class); SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class);
......
...@@ -29,8 +29,8 @@ public class BillDTO { ...@@ -29,8 +29,8 @@ public class BillDTO {
@ApiModelProperty(value = "药品数量") @ApiModelProperty(value = "药品数量")
private Integer physicNum; private Integer physicNum;
@ApiModelProperty(value = "类型(处理模式):1-采购入库、2-申领入库、3-申领出库、4-药品专用登记(科室)" + @ApiModelProperty(value = "类型(处理模式):1-采购入库、2-申领入库、3-申领出库、4-科室专用入(药品专用登记)" +
"、5-回收空安瓿、6-退回空安瓿、7-销毁空安瓿、8-药品专用登记(药房),100-日结,101-月结") "、5-回收空安瓿、6-退回空安瓿、7-销毁空安瓿、8-药房专用出(药品专用登记),100-日结,101-月结")
private Integer type; private Integer type;
@ApiModelProperty(value = "相关申请、入库等表id") @ApiModelProperty(value = "相关申请、入库等表id")
......
...@@ -4,16 +4,32 @@ import com.jmai.sys.dto.PageReq; ...@@ -4,16 +4,32 @@ import com.jmai.sys.dto.PageReq;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Data @Data
public class PhysicBillQueryReq extends PageReq { public class PhysicBillQueryReq extends PageReq {
@ApiModelProperty(value = "药品名称") @ApiModelProperty(value = "药品名称")
private String physicName; private String physicName;
@ApiModelProperty(value = "规格") @ApiModelProperty(value = "规格")
private String physicSpec; private String physicSpec;
@ApiModelProperty(value = "厂家名称") @ApiModelProperty(value = "厂家名称")
private String factoryName; private String factoryName;
@ApiModelProperty(value = "类型(处理模式):1-采购入库、2-申领入库、3-申领出库、4-科室专用入(药品专用登记)" +
"、5-回收空安瓿、6-退回空安瓿、7-销毁空安瓿、8-药房专用出(药品专用登记),100-日结,101-月结")
private Integer type;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "创建时间")
private List<LocalDateTime> createTime;
@ApiModelProperty(value = "创建时间开始", hidden = true)
private LocalDateTime createTimeStart;
@ApiModelProperty(value = "创建时间结束", hidden = true)
private LocalDateTime createTimeEnd;
} }
...@@ -6,6 +6,9 @@ import io.swagger.annotations.ApiModel; ...@@ -6,6 +6,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.LocalDate;
import java.time.YearMonth;
@Data @Data
@ApiModel(description = "药品专账") @ApiModel(description = "药品专账")
@TableName("physic_bill") @TableName("physic_bill")
...@@ -31,7 +34,8 @@ public class PhysicBill extends BaseVersionEntity { ...@@ -31,7 +34,8 @@ public class PhysicBill extends BaseVersionEntity {
@ApiModelProperty(value = "凭证号") @ApiModelProperty(value = "凭证号")
private String voucherNo; private String voucherNo;
@ApiModelProperty(value = "1-采购入库 2-申领入库 3-申领出库") @ApiModelProperty(value = "类型(处理模式):1-采购入库、2-申领入库、3-申领出库、4-科室专用入(药品专用登记)" +
"、5-回收空安瓿、6-退回空安瓿、7-销毁空安瓿、8-药房专用出(药品专用登记),100-日结,101-月结")
private Integer type; private Integer type;
@ApiModelProperty(value = "收入") @ApiModelProperty(value = "收入")
...@@ -39,6 +43,12 @@ public class PhysicBill extends BaseVersionEntity { ...@@ -39,6 +43,12 @@ public class PhysicBill extends BaseVersionEntity {
@ApiModelProperty(value = "发出") @ApiModelProperty(value = "发出")
private Integer expendNum; private Integer expendNum;
@ApiModelProperty(value = "结算日期")
private LocalDate settleDate;
@ApiModelProperty(value = "结算月份(年月)")
private YearMonth settleMonth;
@ApiModelProperty(value = "相关申请、入库id") @ApiModelProperty(value = "相关申请、入库id")
private Long refId; private Long refId;
......
...@@ -28,7 +28,7 @@ public class PhysicRecord extends BaseVersionEntity { ...@@ -28,7 +28,7 @@ public class PhysicRecord extends BaseVersionEntity {
@ApiModelProperty(value = "批号") @ApiModelProperty(value = "批号")
private String batchNo; private String batchNo;
@ApiModelProperty(value = "药品数量") @ApiModelProperty(value = "药品数量(科室出,药房入)")
private Integer physicNum; private Integer physicNum;
@ApiModelProperty(value = "类型:2-药房,3-科室(参考组织部门)") @ApiModelProperty(value = "类型:2-药房,3-科室(参考组织部门)")
......
...@@ -35,6 +35,9 @@ import java.time.LocalDateTime; ...@@ -35,6 +35,9 @@ import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* 药品专用登记 => 药房出,科室入
*/
@Service @Service
public class PhysicRecordServiceImpl extends AbstractService implements PhysicRecordService { public class PhysicRecordServiceImpl extends AbstractService implements PhysicRecordService {
@Resource @Resource
...@@ -90,7 +93,8 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe ...@@ -90,7 +93,8 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
private PhysicRecord newRecord(PhysicRecordCreateReq req, PhysicRecordCreateReq.Physic physic, Integer type) { private PhysicRecord newRecord(PhysicRecordCreateReq req, PhysicRecordCreateReq.Physic physic, Integer type) {
PhysicRecord record = new PhysicRecord(); PhysicRecord record = new PhysicRecord();
BeanUtil.copyProperties(req, record); BeanUtil.copyProperties(req, record);
if (ObjectUtil.equals(type, 2)) { boolean yfDept = ObjectUtil.equals(type, 2);
if (yfDept) {
// 药房 // 药房
Long yfDeptId = DeptEnum.YF.getCode(); Long yfDeptId = DeptEnum.YF.getCode();
record.setDeptId(yfDeptId); record.setDeptId(yfDeptId);
...@@ -191,9 +195,10 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe ...@@ -191,9 +195,10 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
if (finished) { if (finished) {
// 5)完成 => 生成专账 // 5)完成 => 生成专账
boolean yfDept = ObjectUtil.equals(physicRecord.getType(), 2);
BillDTO billDTO = new BillDTO(); BillDTO billDTO = new BillDTO();
BeanUtil.copyProperties(physicRecord, billDTO); BeanUtil.copyProperties(physicRecord, billDTO);
billDTO.setType(ObjectUtil.equals(physicRecord.getType(), 2) ? 8 : 4); billDTO.setType(yfDept ? 8 : 4);
billDTO.setDeptId(physicRecord.getDeptId()); billDTO.setDeptId(physicRecord.getDeptId());
billDTO.setRefId(physicRecord.getId()); billDTO.setRefId(physicRecord.getId());
physicBillService.createBill(billDTO); physicBillService.createBill(billDTO);
......
...@@ -31,8 +31,56 @@ ...@@ -31,8 +31,56 @@
WHERE a.physic_name =#{req.physicName} WHERE a.physic_name =#{req.physicName}
AND a.physic_spec =#{req.physicSpec} AND a.physic_spec =#{req.physicSpec}
AND a.factory_name =#{req.factoryName} AND a.factory_name =#{req.factoryName}
<if test="req.type != null">
AND a.type = #{req.type}
</if>
<if test="req.status != null">
AND a.status = #{req.status}
</if>
<if test="req.createTimeStart != null">
AND a.create_time >= #{req.createTimeStart}
</if>
<if test="req.createTimeEnd != null">
AND a.create_time &lt;= #{req.createTimeEnd}
</if>
ORDER BY a.create_time DESC ORDER BY a.create_time DESC
</select> </select>
<select id="selectSettlementsByCondition" resultType="com.jmai.physic.entity.PhysicBill">
SELECT *
FROM physic_bill
WHERE del_flag = 0
AND type IN (4, 5) <!-- 日结和月结 -->
<if test="deptId != null">
AND dept_id = #{deptId}
</if>
<if test="physicName != null and physicName != ''">
AND physic_name = #{physicName}
</if>
<if test="physicSpec != null and physicSpec != ''">
AND physic_spec = #{physicSpec}
</if>
<if test="factoryName != null and factoryName != ''">
AND factory_name = #{factoryName}
</if>
<if test="batchNo != null and batchNo != ''">
AND batch_no = #{batchNo}
</if>
<if test="type != null">
AND type = #{type}
</if>
<if test="settleDate != null">
AND settle_date = #{settleDate}
</if>
<if test="startSettleDate != null">
AND settle_date >= #{startSettleDate}
</if>
<if test="endSettleDate != null">
AND settle_date &lt;= #{endSettleDate}
</if>
<if test="settleYearMonth != null">
AND settle_year_month = #{settleYearMonth}
</if>
ORDER BY type ASC, settle_date DESC, settle_year_month DESC, create_time DESC
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment