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

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.util.StrUtil;
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.entity.chs.CodeRel;
import com.glxp.udidl.admin.entity.chs.YbDrug;
@ -103,6 +104,11 @@ public class CodeRelController {
if (StrUtil.isNotEmpty(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);
thirdAliDrugList.add(thirdAliDrug);
}
@ -112,5 +118,20 @@ public class CodeRelController {
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;
/**
*
*/
*
*/
@TableField(value = "diNameCode")
public String diNameCode;
/**
*
*/
*
*/
@TableField(value = "drugCode")
public String drugCode;
/**
*
*/
*
*/
@TableField(value = "ybbm")
public String ybbm;
/**
*
*/
*
*/
@TableField(value = "ycCode")
public String ycCode;
/**
*
*/
*
*/
@TableField(value = "sptm")
public String sptm;
/**
*
*/
*
*/
@TableField(value = "ypbwm")
public String ypbwm;
/**
*
*/
*
*/
@TableField(value = "tyshxyh")
public String tyshxyh;
/**
* 9
*/
* 9
*/
@TableField(value = "gjbm")
public String gjbm;
@ -76,6 +76,26 @@ public class CodeRel {
@TableField(value = "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 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) {
this.type = type;
this.manufacturer = manufacturer;

@ -3,6 +3,7 @@ package com.glxp.udidl.admin.service.udchs.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.udidl.admin.dao.chs.CodeRelMapper;
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) {
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);
if ( param == null ||

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