多码融合表增加字段和逻辑

v3
qiuyt 3 months ago
parent ea834f5d17
commit 4e328ffcfe

@ -3,6 +3,7 @@ package com.glxp.udidl.admin.controller.udchs;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.udidl.admin.dto.udchs.BaseParam; import com.glxp.udidl.admin.dto.udchs.BaseParam;
import com.glxp.udidl.admin.entity.chs.CodeRel; import com.glxp.udidl.admin.entity.chs.CodeRel;
import com.glxp.udidl.admin.entity.chs.YbDrug; import com.glxp.udidl.admin.entity.chs.YbDrug;
@ -103,6 +104,11 @@ public class CodeRelController {
if (StrUtil.isNotEmpty(drugCode)){ if (StrUtil.isNotEmpty(drugCode)){
//本地查找 未找到再到阿里查找 //本地查找 未找到再到阿里查找
ThirdAliDrug thirdAliDrug = thirdAliDrugService.getThirdAliDrug(drugCode); ThirdAliDrug thirdAliDrug = thirdAliDrugService.getThirdAliDrug(drugCode);
thirdAliDrug.setPackUnit(codeRel.getPackUnit());
thirdAliDrug.setBhxjsl(codeRel.getBhxjsl());
thirdAliDrug.setXjdw(codeRel.getXjdw());
thirdAliDrug.setYbBzgg(codeRel.getYbBzgg());
thirdAliDrug.setDmcx(true);
// codeRelVo.setThirdAliDrug(thirdAliDrug); // codeRelVo.setThirdAliDrug(thirdAliDrug);
thirdAliDrugList.add(thirdAliDrug); thirdAliDrugList.add(thirdAliDrug);
} }
@ -112,5 +118,20 @@ public class CodeRelController {
return ResultVOUtils.success(thirdAliDrugList); return ResultVOUtils.success(thirdAliDrugList);
} }
@ApiOperation(value = "更新指定信息", response = CodeRel.class)
@PostMapping("/delete")
public BaseResponse delete(@RequestBody CodeRel param) {
if ( param == null ||
(StrUtil.isBlank(param.getYbbm()) && StrUtil.isBlank(param.getYbbm()))
){
return ResultVOUtils.error(ResultEnum.DATA_ERROR,"参数错误");
}
boolean b = codeRelService.remove(
new QueryWrapper<CodeRel>().eq("drugCode",param.getDrugCode()).eq("ybbm",param.getYbbm())
);
if (!b){
return ResultVOUtils.error(500,"删除失败");
}
return ResultVOUtils.success("删除失败");
}
} }

@ -18,50 +18,50 @@ public class CodeRel {
public Integer id; public Integer id;
/** /**
* *
*/ */
@TableField(value = "diNameCode") @TableField(value = "diNameCode")
public String diNameCode; public String diNameCode;
/** /**
* *
*/ */
@TableField(value = "drugCode") @TableField(value = "drugCode")
public String drugCode; public String drugCode;
/** /**
* *
*/ */
@TableField(value = "ybbm") @TableField(value = "ybbm")
public String ybbm; public String ybbm;
/** /**
* *
*/ */
@TableField(value = "ycCode") @TableField(value = "ycCode")
public String ycCode; public String ycCode;
/** /**
* *
*/ */
@TableField(value = "sptm") @TableField(value = "sptm")
public String sptm; public String sptm;
/** /**
* *
*/ */
@TableField(value = "ypbwm") @TableField(value = "ypbwm")
public String ypbwm; public String ypbwm;
/** /**
* *
*/ */
@TableField(value = "tyshxyh") @TableField(value = "tyshxyh")
public String tyshxyh; public String tyshxyh;
/** /**
* 9 * 9
*/ */
@TableField(value = "gjbm") @TableField(value = "gjbm")
public String gjbm; public String gjbm;
@ -76,6 +76,26 @@ public class CodeRel {
@TableField(value = "fromType") @TableField(value = "fromType")
public Integer fromType; public Integer fromType;
/**
*
*/
@TableField(value = "packUnit")
public String packUnit;
/**
*
*/
@TableField(value = "bhxjsl")
public Integer bhxjsl;
/**
*
*/
@TableField(value = "xjdw")
public String xjdw;
/**
*
*/
@TableField(value = "ybBzgg")
public String ybBzgg;
} }

@ -161,6 +161,28 @@ public class ThirdAliDrug implements Serializable {
private String packUnitName; private String packUnitName;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(exist = false)
public String packUnit;
/**
*
*/
@TableField(exist = false)
public Integer bhxjsl;
/**
*
*/
@TableField(exist = false)
public String xjdw;
/**
*
*/
@TableField(exist = false)
public String ybBzgg;
@TableField(exist = false)
public boolean dmcx = false;
public ThirdAliDrug(String type, String manufacturer, String cpmctymc, String form, String formSpec, String bzgg, String approvalNum, String spmc, String nameCode, String packRatio, String packLevel, Date createTime, Date updateTime) { public ThirdAliDrug(String type, String manufacturer, String cpmctymc, String form, String formSpec, String bzgg, String approvalNum, String spmc, String nameCode, String packRatio, String packLevel, Date createTime, Date updateTime) {
this.type = type; this.type = type;
this.manufacturer = manufacturer; this.manufacturer = manufacturer;

@ -3,6 +3,7 @@ package com.glxp.udidl.admin.service.udchs.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.udidl.admin.dao.chs.CodeRelMapper; import com.glxp.udidl.admin.dao.chs.CodeRelMapper;
import com.glxp.udidl.admin.entity.chs.CodeRel; import com.glxp.udidl.admin.entity.chs.CodeRel;
@ -29,7 +30,14 @@ public class CodeRelServiceImpl extends ServiceImpl<CodeRelMapper, CodeRel> {
} }
public void updateBatchByCodeRel(List<CodeRel> paramList) { public void updateBatchByCodeRel(List<CodeRel> paramList) {
for (int i = 0; i < paramList.size(); i++) { for (int i = 0; i < paramList.size(); i++) {
if(i == 0){
CodeRel param = paramList.get(i);
this.remove(
new QueryWrapper<CodeRel>().eq("ybbm",param.getYbbm())
);
}
CodeRel param = paramList.get(i); CodeRel param = paramList.get(i);
if ( param == null || if ( param == null ||

@ -20,12 +20,12 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, diNameCode, drugCode, ybbm, ycCode, sptm, ypbwm, tyshxyh, gjbm, `status`, updateTime, id, diNameCode, drugCode, ybbm, ycCode, sptm, ypbwm, tyshxyh, gjbm, `status`, updateTime,
createTime, fromType createTime, fromType
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from code_rel from code_rel
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
@ -37,14 +37,14 @@
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glxp.udidl.admin.entity.chs.CodeRel" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glxp.udidl.admin.entity.chs.CodeRel" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into code_rel (diNameCode, drugCode, ybbm, insert into code_rel (diNameCode, drugCode, ybbm,
ycCode, sptm, ypbwm, ycCode, sptm, ypbwm,
tyshxyh, gjbm, `status`, tyshxyh, gjbm, `status`,
updateTime, createTime, fromType updateTime, createTime, fromType
) )
values (#{diNameCode,jdbcType=VARCHAR}, #{drugCode,jdbcType=VARCHAR}, #{ybbm,jdbcType=VARCHAR}, values (#{diNameCode,jdbcType=VARCHAR}, #{drugCode,jdbcType=VARCHAR}, #{ybbm,jdbcType=VARCHAR},
#{ycCode,jdbcType=VARCHAR}, #{sptm,jdbcType=VARCHAR}, #{ypbwm,jdbcType=VARCHAR}, #{ycCode,jdbcType=VARCHAR}, #{sptm,jdbcType=VARCHAR}, #{ypbwm,jdbcType=VARCHAR},
#{tyshxyh,jdbcType=VARCHAR}, #{gjbm,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{tyshxyh,jdbcType=VARCHAR}, #{gjbm,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{fromType,jdbcType=TINYINT} #{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{fromType,jdbcType=TINYINT}
) )
</insert> </insert>
@ -88,6 +88,18 @@
<if test="fromType != null"> <if test="fromType != null">
fromType, fromType,
</if> </if>
<if test="packUnit != null">
packUnit,
</if>
<if test="bhxjsl != null">
bhxjsl,
</if>
<if test="xjdw != null">
xjdw,
</if>
<if test="ybBzgg != null">
ybBzgg,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="diNameCode != null"> <if test="diNameCode != null">
@ -126,6 +138,18 @@
<if test="fromType != null"> <if test="fromType != null">
#{fromType,jdbcType=TINYINT}, #{fromType,jdbcType=TINYINT},
</if> </if>
<if test="packUnit != null">
#{packUnit,jdbcType=VARCHAR},
</if>
<if test="bhxjsl != null">
#{bhxjsl,jdbcType=INTEGER},
</if>
<if test="xjdw != null">
#{xjdw,jdbcType=VARCHAR},
</if>
<if test="ybBzgg != null">
#{ybBzgg,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.chs.CodeRel"> <update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.chs.CodeRel">
@ -225,6 +249,18 @@
<if test="fromType != null"> <if test="fromType != null">
fromType = #{fromType,jdbcType=TINYINT}, fromType = #{fromType,jdbcType=TINYINT},
</if> </if>
<if test="packUnit != null">
packUnit = #{packUnit,jdbcType=VARCHAR},
</if>
<if test="bhxjsl != null">
bhxjsl = #{bhxjsl,jdbcType=INTEGER},
</if>
<if test="xjdw != null">
xjdw = #{xjdw,jdbcType=VARCHAR},
</if>
<if test="ybBzgg != null">
ybBzgg = #{ybBzgg,jdbcType=VARCHAR},
</if>
</set> </set>
<where> <where>
<if test="diNameCode != null"> <if test="diNameCode != null">
@ -236,4 +272,4 @@
</where> </where>
</update> </update>
</mapper> </mapper>

@ -351,3 +351,16 @@ CREATE TABLE IF NOT EXISTS `auth_ali_user`
INSERT IGNORE INTO `auth_ali_user` ( `id`, `erpId`, `appKey`, `appSecret`, `refEntId`, `type` ) INSERT IGNORE INTO `auth_ali_user` ( `id`, `erpId`, `appKey`, `appSecret`, `refEntId`, `type` )
VALUES VALUES
( 1, NULL, '31721223', '5231c601505706a9d49823c3dfe2cb01', 'ef99b78bd9c54c1284f813149c858fb0', NULL ); ( 1, NULL, '31721223', '5231c601505706a9d49823c3dfe2cb01', 'ef99b78bd9c54c1284f813149c858fb0', NULL );
CALL Pro_Temp_ColumnWork('code_rel', 'packUnit',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''层级单位''',
1);
CALL Pro_Temp_ColumnWork('code_rel', 'bhxjsl',
' int DEFAULT NULL COMMENT ''包含下级数量''',
1);
CALL Pro_Temp_ColumnWork('code_rel', 'xjdw',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''下级单位''',
1);
CALL Pro_Temp_ColumnWork('code_rel', 'ybBzgg',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''医保包装规格''',
1);

Loading…
Cancel
Save