Kaynağa Gözat

设备档案卡 页面 新增 “性能验证记录”tab页 (港大医院专属需求)

ZhuJiaHao 1 ay önce
ebeveyn
işleme
865629253c

+ 1 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/aop/EquipmentDBLogAspect.java

@@ -41,6 +41,7 @@ public class EquipmentDBLogAspect {
         PATH_TO_TABLE_MAP.put("equipment/maintenanceRecord", "T_MJSBWHBYJLBY");
         PATH_TO_TABLE_MAP.put("equipment/repairRecord", "T_SBWXJLB");
         PATH_TO_TABLE_MAP.put("equipment/scrappedRecord", "T_SBTYBFJLB");
+        PATH_TO_TABLE_MAP.put("equipment/perfVerificationRecord", "T_XNYZJL");
     }
 
     @Resource

+ 32 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/equipment/api/IPerfVerificationRecordService.java

@@ -0,0 +1,32 @@
+package com.lc.ibps.components.equipment.api;
+
+
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 《设备性能验证记录》
+ *
+ * 港大医院需求增加该页面
+ * 页面位置在 “设备档案卡” 页面内 新增了tab页“性能验证记录”
+ */
+
+
+@Validated
+@RequestMapping(value = "/equipment/perfVerificationRecord")
+@RestController
+public interface IPerfVerificationRecordService {
+
+    @RequestMapping(value = "/query", method = RequestMethod.POST)
+    public APIResult<APIPageList<PerfVerificationRecordPo>> query(
+            @RequestBody(required = true) APIRequest request);
+
+
+}

+ 35 - 2
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/equipment/domain/EquipmentCard.java

@@ -3,6 +3,8 @@ package com.lc.ibps.components.equipment.domain;
 
 import javax.annotation.Resource;
 
+import com.lc.ibps.entrust.dao.PerfVerificationRecordDao;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.stereotype.Service;
@@ -21,6 +23,7 @@ import com.lc.ibps.components.equipment.repository.AccessoriesDeviceRepository;
 import com.lc.ibps.components.equipment.persistence.entity.AccessoriesDevicePo;
 import com.lc.ibps.components.equipment.repository.MaintenanceItemRepository;
 import com.lc.ibps.components.equipment.persistence.entity.MaintenanceItemPo;
+import com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo;
 
 /**
  * 设备档案卡 领域对象实体
@@ -49,6 +52,9 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
 	@Resource
 	private MaintenanceItemRepository maintenanceItemRepository;
 
+	@Autowired
+	private PerfVerificationRecordDao perfVerificationRecordDao;
+
 	protected void init(){
 		//
 	}
@@ -82,7 +88,8 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
 			MaintenanceItem maintenanceItem = maintenanceItemRepository.newInstance();
 			maintenanceItem.deleteByMainId(getData().getId());
 		}
-		
+
+		// “附属设备及配件” tab页数据的处理
 		AccessoriesDevice accessoriesDevice = accessoriesDeviceRepository.newInstance();
 		if(BeanUtils.isNotEmpty(getData().getAccessoriesDevicePoList())){
 			for(AccessoriesDevicePo accessoriesDevicePo:getData().getAccessoriesDevicePoList()){
@@ -91,6 +98,8 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
 				accessoriesDevice.save(accessoriesDevicePo);
 			}
 		}
+
+		//“维护项目” tab页数据的处理
 		MaintenanceItem maintenanceItem = maintenanceItemRepository.newInstance();
 		if(BeanUtils.isNotEmpty(getData().getMaintenanceItemPoList())){
 			for(MaintenanceItemPo maintenanceItemPo:getData().getMaintenanceItemPoList()){
@@ -99,6 +108,30 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
 				maintenanceItem.save(maintenanceItemPo);
 			}
 		}
+
+		//“性能验证记录” tab页数据的处理
+		if(BeanUtils.isNotEmpty(getData().getPerfVerificationRecordPoList())){
+			java.util.List<String> existingIds = perfVerificationRecordDao.getIdsBySheBeiId(getData().getId());
+			java.util.List<String> currentIds = new java.util.ArrayList<>();
+			for(PerfVerificationRecordPo po : getData().getPerfVerificationRecordPoList()){
+				po.setSheBeiId(getData().getId());
+				if(StringUtil.isEmpty(po.getId())){
+					po.setId(com.lc.ibps.base.framework.id.UniqueIdUtil.getId());
+					perfVerificationRecordDao.insert(po);
+				}else{
+					perfVerificationRecordDao.update(po);
+				}
+				currentIds.add(po.getId());
+			}
+			for(String existingId : existingIds){
+				if(!currentIds.contains(existingId)){
+					perfVerificationRecordDao.deleteById(existingId);
+				}
+			}
+		}
+
+
+
 	}	
 	
 	/**
@@ -123,4 +156,4 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
 	}
 	
 	
-}
+}

+ 10 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/equipment/persistence/entity/EquipmentCardPo.java

@@ -43,6 +43,16 @@ public class EquipmentCardPo extends EquipmentCardTbl{
 		this.maintenanceItemPoList = maintenanceItemPoList;
 	}
 
+	//港大医院项目,新增“性能验证记录”
+	private List<PerfVerificationRecordPo> perfVerificationRecordPoList = new ArrayList<PerfVerificationRecordPo>();
+	public List<PerfVerificationRecordPo> getPerfVerificationRecordPoList() {
+		return perfVerificationRecordPoList;
+	}
+	public void setPerfVerificationRecordPoList(List<PerfVerificationRecordPo> perfVerificationRecordPoList) {
+		this.perfVerificationRecordPoList = perfVerificationRecordPoList;
+	}
+
+
 	public static EquipmentCardPo fromJsonString(String data){
 		if(JacksonUtil.isNotJsonObject(data)){
 			return null;

+ 184 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/equipment/persistence/entity/PerfVerificationRecordPo.java

@@ -0,0 +1,184 @@
+package com.lc.ibps.components.equipment.persistence.entity;
+
+import com.lc.ibps.base.framework.persistence.entity.AbstractPo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 设备性能验证记录表 表对象
+ *
+ */
+@SuppressWarnings("serial")
+@ApiModel(value = "设备性能验证记录表对象")
+public class PerfVerificationRecordPo extends AbstractPo<String>{
+	@ApiModelProperty(value = "主键")
+	protected String  id; 		/*主键*/
+	@ApiModelProperty(value = "租户ID")
+	protected String  tenantId; 		/*租户ID*/
+	@ApiModelProperty(value = "IP地址")
+	protected String  ip; 		/*IP地址*/
+	@ApiModelProperty(value = "是否过审")
+	protected String  shiFouGuoShen; 		/*是否过审*/
+	@ApiModelProperty(value = "设备id")
+	protected String  sheBeiId; 		/*设备id*/
+	@ApiModelProperty(value = "地点")
+	protected String  diDian; 		/*地点*/
+	@ApiModelProperty(value = "编制人")
+	protected String  bianZhiRen; 		/*编制人*/
+	@ApiModelProperty(value = "编制部门")
+	protected String  bianZhiBuMen; 		/*编制部门*/
+	@ApiModelProperty(value = "编制时间")
+	protected String  bianZhiShiJian; 		/*编制时间*/
+	@ApiModelProperty(value = "快照")
+	protected String  kuaiZhao; 		/*快照*/
+	@ApiModelProperty(value = "附件")
+	protected String  fuJian; 		/*附件*/
+	@ApiModelProperty(value = "备注")
+	protected String  beiZhu; 		/*备注*/
+
+	public void setId(String id) 
+	{
+		this.id = id;
+	}
+	/**
+	 * 返回 主键
+	 * @return
+	 */
+	public String getId() 
+	{
+		return this.id;
+	}
+	public void setTenantId(String tenantId) 
+	{
+		this.tenantId = tenantId;
+	}
+	/**
+	 * 返回 租户ID
+	 * @return
+	 */
+	public String getTenantId() 
+	{
+		return this.tenantId;
+	}
+	public void setIp(String ip) 
+	{
+		this.ip = ip;
+	}
+	/**
+	 * 返回 IP地址
+	 * @return
+	 */
+	public String getIp() 
+	{
+		return this.ip;
+	}
+	public void setShiFouGuoShen(String shiFouGuoShen) 
+	{
+		this.shiFouGuoShen = shiFouGuoShen;
+	}
+	/**
+	 * 返回 是否过审
+	 * @return
+	 */
+	public String getShiFouGuoShen() 
+	{
+		return this.shiFouGuoShen;
+	}
+	public void setSheBeiId(String sheBeiId) 
+	{
+		this.sheBeiId = sheBeiId;
+	}
+	/**
+	 * 返回 设备id
+	 * @return
+	 */
+	public String getSheBeiId() 
+	{
+		return this.sheBeiId;
+	}
+	public void setDiDian(String diDian) 
+	{
+		this.diDian = diDian;
+	}
+	/**
+	 * 返回 地点
+	 * @return
+	 */
+	public String getDiDian() 
+	{
+		return this.diDian;
+	}
+	public void setBianZhiRen(String bianZhiRen) 
+	{
+		this.bianZhiRen = bianZhiRen;
+	}
+	/**
+	 * 返回 编制人
+	 * @return
+	 */
+	public String getBianZhiRen() 
+	{
+		return this.bianZhiRen;
+	}
+	public void setBianZhiBuMen(String bianZhiBuMen) 
+	{
+		this.bianZhiBuMen = bianZhiBuMen;
+	}
+	/**
+	 * 返回 编制部门
+	 * @return
+	 */
+	public String getBianZhiBuMen() 
+	{
+		return this.bianZhiBuMen;
+	}
+	public void setBianZhiShiJian(String bianZhiShiJian) 
+	{
+		this.bianZhiShiJian = bianZhiShiJian;
+	}
+	/**
+	 * 返回 编制时间
+	 * @return
+	 */
+	public String getBianZhiShiJian() 
+	{
+		return this.bianZhiShiJian;
+	}
+	public void setKuaiZhao(String kuaiZhao) 
+	{
+		this.kuaiZhao = kuaiZhao;
+	}
+	/**
+	 * 返回 快照
+	 * @return
+	 */
+	public String getKuaiZhao() 
+	{
+		return this.kuaiZhao;
+	}
+	public void setFuJian(String fuJian) 
+	{
+		this.fuJian = fuJian;
+	}
+	/**
+	 * 返回 附件
+	 * @return
+	 */
+	public String getFuJian() 
+	{
+		return this.fuJian;
+	}
+	public void setBeiZhu(String beiZhu) 
+	{
+		this.beiZhu = beiZhu;
+	}
+	/**
+	 * 返回 备注
+	 * @return
+	 */
+	public String getBeiZhu() 
+	{
+		return this.beiZhu;
+	}
+	
+}

+ 105 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/equipment/provider/PerfVerificationRecordProvider.java

@@ -0,0 +1,105 @@
+package com.lc.ibps.components.equipment.provider;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
+
+
+import com.lc.ibps.api.base.constants.StateEnum;
+import com.lc.ibps.api.base.page.Page;
+import com.lc.ibps.api.base.query.FieldSort;
+import com.lc.ibps.api.base.query.QueryFilter;
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.base.core.util.string.StringUtil;
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIPageResult;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import com.lc.ibps.cloud.provider.GenericProvider;
+import com.lc.ibps.components.equipment.api.IPerfVerificationRecordService;
+import com.lc.ibps.entrust.dao.PerfVerificationRecordDao;
+import com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+/**
+ * 《设备性能验证记录》
+ *
+ * 港大医院需求增加该页面
+ * 页面位置在 “设备档案卡” 页面内 新增了tab页“性能验证记录”
+ */
+
+
+@Api(tags = "设备档案卡管理", value = "设备性能验证记录")
+@Service
+public class PerfVerificationRecordProvider extends GenericProvider implements IPerfVerificationRecordService {
+
+    @Autowired
+    private PerfVerificationRecordDao perfVerificationRecordDao;
+
+    @ApiOperation(value = "设备性能验证记录列表(分页条件查询)数据", notes = "设备性能验证记录列表(分页条件查询)数据")
+    @Override
+    public APIResult<APIPageList<PerfVerificationRecordPo>> query(
+            @ApiParam(name = "request", value = "传入查询请求json字符串", required = true)
+            @RequestBody(required = true) APIRequest request) {
+        APIResult<APIPageList<PerfVerificationRecordPo>> result = new APIResult<>();
+        try {
+            QueryFilter queryFilter = getQueryFilter(request);
+            
+            // 将QueryFilter转换为Map,并生成whereSql和orderBySql
+            Map<String, Object> params = queryFilter.getParams();
+            
+            // 构建动态条件SQL
+            String dynamicWhereSql = queryFilter.getFieldLogic().getSql();
+            if (StringUtil.isNotEmpty(dynamicWhereSql)) {
+                params.put("whereSql", dynamicWhereSql);
+            }
+            
+            // 构建排序SQL
+            if (BeanUtils.isNotEmpty(queryFilter.getFieldSortList())) {
+                StringBuffer sb = new StringBuffer();
+                for (FieldSort fieldSort : queryFilter.getFieldSortList()) {
+                    sb.append(fieldSort.getField()).append(" ").append(fieldSort.getDirection()).append(",");
+                }
+                sb.deleteCharAt(sb.length() - 1);
+                params.put("orderBySql", sb.toString());
+            }
+            
+            // 分页参数
+            Page page = queryFilter.getPage();
+            List<PerfVerificationRecordPo> data;
+            APIPageList<PerfVerificationRecordPo> apiPageData = new APIPageList<>();
+            
+            if (page != null) {
+                // 先查询总数
+                int total = perfVerificationRecordDao.queryCount(params);
+                
+                // 计算分页参数
+                int offset = (page.getPageNo() - 1) * page.getPageSize();
+                params.put("offset", offset);
+                params.put("limit", page.getPageSize());
+                
+                // 查询数据
+                data = perfVerificationRecordDao.query(params);
+                
+                // 设置分页结果
+                APIPageResult pageResult = new APIPageResult(page.getPageNo(), page.getPageSize(), total);
+                apiPageData.setPageResult(pageResult);
+                apiPageData.setDataResult(data);
+            } else {
+                // 无分页查询
+                data = perfVerificationRecordDao.query(params);
+                apiPageData.setDataResult(data);
+            }
+            result.setData(apiPageData);
+        } catch (Exception e) {
+            setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+        }
+        return result;
+    }
+}

+ 24 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/entrust/dao/PerfVerificationRecordDao.java

@@ -0,0 +1,24 @@
+package com.lc.ibps.entrust.dao;
+
+import com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface PerfVerificationRecordDao {
+
+    List<PerfVerificationRecordPo> query(Map<String, Object> params);
+    
+    int queryCount(Map<String, Object> params);
+
+    void insert(PerfVerificationRecordPo po);
+
+    void update(PerfVerificationRecordPo po);
+
+    void deleteById(String id);
+
+    List<String> getIdsBySheBeiId(String sheBeiId);
+
+}

+ 138 - 0
ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/equipment/persistence/mapping/PerfVerificationRecord.map.xml

@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.lc.ibps.entrust.dao.PerfVerificationRecordDao">
+
+    <resultMap id="PerfVerificationRecordPoResult" type="com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo">
+        <id property="id" column="id_" />
+        <result property="tenantId" column="tenant_id_" />
+        <result property="ip" column="ip_" />
+        <result property="createBy" column="create_by_" />
+        <result property="createTime" column="create_time_" />
+        <result property="updateBy" column="update_by_" />
+        <result property="updateTime" column="update_time_" />
+        <result property="shiFouGuoShen" column="shi_fou_guo_shen_" />
+        <result property="diDian" column="di_dian_" />
+        <result property="bianZhiRen" column="bian_zhi_ren_" />
+        <result property="bianZhiBuMen" column="bian_zhi_bu_men_" />
+        <result property="bianZhiShiJian" column="bian_zhi_shi_jian" />
+        <result property="kuaiZhao" column="kuai_zhao_" />
+        <result property="fuJian" column="fu_jian_" />
+        <result property="beiZhu" column="bei_zhu_" />
+        <result property="sheBeiId" column="she_bei_id_" />
+    </resultMap>
+
+    <sql id="columns">
+        id_,
+        tenant_id_,
+        ip_,
+        create_by_,
+        create_time_,
+        update_by_,
+        update_time_,
+        shi_fou_guo_shen_,
+        di_dian_,
+        bian_zhi_ren_,
+        bian_zhi_bu_men_,
+        bian_zhi_shi_jian,
+        kuai_zhao_,
+        fu_jian_,
+        bei_zhu_,
+        she_bei_id_
+    </sql>
+
+    <select id="query" parameterType="java.util.Map" resultMap="PerfVerificationRecordPoResult">
+        SELECT <include refid="columns" />
+        FROM t_xnyzjl
+        <where>
+            <if test="@o.Ognl@isNotEmpty(whereSql)">
+                ${whereSql}
+            </if>
+        </where>
+        <if test="@o.Ognl@isNotEmpty(orderBySql)">
+            ORDER BY ${orderBySql}
+        </if>
+        <if test="@o.Ognl@isEmpty(orderBySql)">
+            ORDER BY id_ DESC
+        </if>
+        <if test="offset != null and limit != null">
+            LIMIT #{offset}, #{limit}
+        </if>
+    </select>
+
+    <select id="queryCount" parameterType="java.util.Map" resultType="int">
+        SELECT COUNT(1)
+        FROM t_xnyzjl
+        <where>
+            <if test="@o.Ognl@isNotEmpty(whereSql)">
+                ${whereSql}
+            </if>
+        </where>
+    </select>
+
+    <insert id="insert" parameterType="com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo">
+        INSERT INTO t_xnyzjl (
+            id_,
+            tenant_id_,
+            ip_,
+            create_by_,
+            create_time_,
+            update_by_,
+            update_time_,
+            shi_fou_guo_shen_,
+            di_dian_,
+            bian_zhi_ren_,
+            bian_zhi_bu_men_,
+            bian_zhi_shi_jian,
+            kuai_zhao_,
+            fu_jian_,
+            bei_zhu_,
+            she_bei_id_
+        ) VALUES (
+            #{id},
+            #{tenantId},
+            #{ip},
+            #{createBy},
+            #{createTime},
+            #{updateBy},
+            #{updateTime},
+            #{shiFouGuoShen},
+            #{diDian},
+            #{bianZhiRen},
+            #{bianZhiBuMen},
+            #{bianZhiShiJian},
+            #{kuaiZhao},
+            #{fuJian},
+            #{beiZhu},
+            #{sheBeiId}
+        )
+    </insert>
+
+    <update id="update" parameterType="com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo">
+        UPDATE t_xnyzjl
+        SET
+            tenant_id_ = #{tenantId},
+            ip_ = #{ip},
+            update_by_ = #{updateBy},
+            update_time_ = #{updateTime},
+            shi_fou_guo_shen_ = #{shiFouGuoShen},
+            di_dian_ = #{diDian},
+            bian_zhi_ren_ = #{bianZhiRen},
+            bian_zhi_bu_men_ = #{bianZhiBuMen},
+            bian_zhi_shi_jian = #{bianZhiShiJian},
+            kuai_zhao_ = #{kuaiZhao},
+            fu_jian_ = #{fuJian},
+            bei_zhu_ = #{beiZhu},
+            she_bei_id_ = #{sheBeiId}
+        WHERE id_ = #{id}
+    </update>
+
+    <delete id="deleteById" parameterType="java.lang.String">
+        DELETE FROM t_xnyzjl WHERE id_ = #{id}
+    </delete>
+
+    <select id="getIdsBySheBeiId" parameterType="java.lang.String" resultType="java.lang.String">
+        SELECT id_ FROM t_xnyzjl WHERE she_bei_id_ = #{sheBeiId}
+    </select>
+
+</mapper>