1、无码信息申报

dev_2.5_optimize_250306
qiuyt 4 months ago
parent a18e59294e
commit 32eac9ebf5

@ -0,0 +1,119 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.dao.system.ThrYbSetupMapper;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.entity.system.ThrYbSetup;
import com.glxp.api.req.basic.YbNotCodeQuery;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.YbNotCodeResponse;
import com.glxp.api.service.basic.impl.YbNotCodeServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.List;
@Slf4j
@RestController
public class YbNotCodeController {
@Resource
YbNotCodeServiceImpl ybNotCodeService;
@Resource
private ThrYbSetupMapper thrYbSetupMapper;
@PostMapping("/udi/ybNotCode/page")
public BaseResponse page(@RequestBody YbNotCodeQuery query) {
List<YbNotCode> list = ybNotCodeService.pageList(query);
PageInfo pageInfo = new PageInfo<>(list);
PageSimpleResponse page = new PageSimpleResponse();
page.setTotal(pageInfo.getTotal());
page.setList(pageInfo.getList());
return ResultVOUtils.success(page);
}
@PostMapping("/udi/ybNotCode/add")
public BaseResponse add(@RequestBody YbNotCode ybNotCode) {
return ResultVOUtils.success(ybNotCodeService.add(ybNotCode));
}
@PostMapping("/udi/ybNotCode/update")
public BaseResponse update(@RequestBody YbNotCode ybNotCode) {
return ResultVOUtils.success(ybNotCodeService.update(ybNotCode));
}
@PostMapping("/udi/ybNotCode/delete")
public BaseResponse delete(@RequestBody YbNotCode ybNotCode) {
return ResultVOUtils.success(ybNotCodeService.delete(ybNotCode));
}
@GetMapping("/udi/ybNotCode/export")
public void export( YbNotCodeQuery query,HttpServletResponse response) throws IOException {
List<YbNotCode> list;
if(query.getExcelType() !=null && query.getExcelType() == 1
){
list = ybNotCodeService.pageList( query );
}else {
list = ybNotCodeService.list( new QueryWrapper<>());
}
List<YbNotCodeResponse> splitCodeEntities = BeanUtil.copyToList(list, YbNotCodeResponse.class);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode("无码药品信息管理模板" + DateUtil.format(new Date(), "yyyy-MM-dd") + ".xlsx", StandardCharsets.UTF_8.name()));
// 定义表头样式
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 设置表头背景颜色为淡蓝色
headWriteCellStyle.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.getIndex()); // 淡蓝色对应的索引值
WriteFont headWriteFont = new WriteFont();
headWriteFont.setFontHeightInPoints((short) 11);
headWriteCellStyle.setWriteFont(headWriteFont);
// 定义内容样式
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
// 构建样式策略
HorizontalCellStyleStrategy horizontalCellStyleStrategy =
new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
EasyExcel.write(response.getOutputStream(), YbNotCodeResponse.class).registerWriteHandler(horizontalCellStyleStrategy) .// 注册自定义样式处理器
sheet("无码药品申报导入").doWrite(splitCodeEntities);
}
@GetMapping("/udi/ybNotCode/getOrganizationCode")
public BaseResponse getOrganizationCode() {
ThrYbSetup thrYbSetup = thrYbSetupMapper.selectOne(
new QueryWrapper<ThrYbSetup>()
.last("limit 1")
);
String appId = "";
if(thrYbSetup!=null && StringUtils.isNotEmpty(thrYbSetup.getAppId())){
appId = thrYbSetup.getAppId();
}
return ResultVOUtils.success(appId);
}
}

@ -1,19 +1,14 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.req.basic.YbNotCodeQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface YbNotCodeMapper {
int deleteByPrimaryKey(String ybbm);
int insert(YbNotCode record);
int insertSelective(YbNotCode record);
import java.util.List;
YbNotCode selectByPrimaryKey(String ybbm);
int updateByPrimaryKeySelective(YbNotCode record);
int updateByPrimaryKey(YbNotCode record);
}
@Mapper
public interface YbNotCodeMapper extends BaseMapper<YbNotCode> {
List<YbNotCode> pageList(@Param("vo") YbNotCodeQuery ybNotCodeQuery);
}

@ -0,0 +1,9 @@
package com.glxp.api.dao.system;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.system.ThrYbSetup;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ThrYbSetupMapper extends BaseMapper<ThrYbSetup> {
}

@ -1,5 +1,9 @@
package com.glxp.api.entity.basic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -8,26 +12,25 @@ import lombok.NoArgsConstructor;
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "yb_not_code")
public class YbNotCode {
/**
*
*/
@TableId(value = "ybbm", type = IdType.INPUT)
private String ybbm;
/**
*
*/
private String organizationcode;
@TableField(value = "organizationCode")
private String organizationCode;
/**
*
* 1
* 5
* 6
* 7
* 0
* 1 5 6 7 0
*/
private Integer notcodetype;
@TableField(value = "notCodeType")
private Integer notCodeType;
@TableField(exist = false)
private String notCodeTypeName;
}

@ -0,0 +1,98 @@
package com.glxp.api.entity.system;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
@Data
@TableName(value = "thr_yb_setup")
public class ThrYbSetup implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Integer id;
@TableField(value = "url")
private String url;
@TableField(value = "appId")
private String appId;
@TableField(value = "appSecret")
private String appSecret;
@TableField(value = "signKey")
private String signKey;
@TableField(value = "encKey")
private String encKey;
/**
*
*/
@TableField(value = "mdtrtarea_admvs")
private String mdtrtarea_admvs;
/**
*
*/
@TableField(value = "insuplc_admdvs")
private String insuplc_admdvs;
/**
*
*/
@TableField(value = "opter")
private String opter;
/**
*
*/
@TableField(value = "opter_name")
private String opter_name;
/**
*
*/
@TableField(value = "fixmedins_code")
private String fixmedins_code;
/**
*
*/
@TableField(value = "fixmedins_name")
private String fixmedins_name;
/**
*
*/
@TableField(value = "infver")
private String infver;
/**
*
*/
@TableField(value = "recer_sys_code")
private String recer_sys_code;
/**
*
*/
@TableField(value = "opter_type")
private String opter_type;
@TableField(value = "sequenceNum")
private String sequenceNum;
@TableField(value = "opter_no")
private String opter_no;
@TableField(value = "mac")
private String mac;
@TableField(value = "ip")
private String ip;
@TableField(value = "signNo")
private String signNo;
@TableField(value = "signData")
private String signData;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,31 @@
package com.glxp.api.req.basic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
@Data
public class YbNotCodeQuery extends ListPageRequest {
/**
*
*/
@TableId(value = "ybbm", type = IdType.INPUT)
private String ybbm;
/**
*
*/
@TableField(value = "organizationCode")
private String organizationCode;
/**
* 1 5 6 7 0
*/
@TableField(value = "notCodeType")
private Integer notCodeType;
private Integer excelType;
}

@ -0,0 +1,26 @@
package com.glxp.api.res.basic;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
@Data
@HeadRowHeight(16) // 设置表头 高度 为 40
public class YbNotCodeResponse {
@ExcelProperty(value = "机构编码", index = 0)
@ColumnWidth(32)
private String ybbm;
@ExcelProperty(value = "国家医保目录编码", index = 1)
@ColumnWidth(28)
private String organizationCode;
@ExcelProperty(value = "无码类型(仅填数字即可)", index = 2)
@ColumnWidth(54)
private String notCodeType;
}

@ -1,43 +0,0 @@
package com.glxp.api.service.auth;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.dao.basic.YbNotCodeMapper;
@Service
public class YbNotCodeService{
@Resource
private YbNotCodeMapper ybNotCodeMapper;
public int deleteByPrimaryKey(String ybbm) {
return ybNotCodeMapper.deleteByPrimaryKey(ybbm);
}
public int insert(YbNotCode record) {
return ybNotCodeMapper.insert(record);
}
public int insertSelective(YbNotCode record) {
return ybNotCodeMapper.insertSelective(record);
}
public YbNotCode selectByPrimaryKey(String ybbm) {
return ybNotCodeMapper.selectByPrimaryKey(ybbm);
}
public int updateByPrimaryKeySelective(YbNotCode record) {
return ybNotCodeMapper.updateByPrimaryKeySelective(record);
}
public int updateByPrimaryKey(YbNotCode record) {
return ybNotCodeMapper.updateByPrimaryKey(record);
}
}

@ -0,0 +1,20 @@
package com.glxp.api.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.req.basic.YbNotCodeQuery;
import java.util.List;
public interface YbNotCodeService extends IService<YbNotCode>{
List<YbNotCode> pageList(YbNotCodeQuery query);
Boolean add(YbNotCode ybNotCode);
Boolean update(YbNotCode ybNotCode);
Boolean delete(YbNotCode ybNotCode);
}

@ -0,0 +1,44 @@
package com.glxp.api.service.basic.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.YbNotCodeMapper;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.req.basic.YbNotCodeQuery;
import com.glxp.api.service.basic.YbNotCodeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class YbNotCodeServiceImpl extends ServiceImpl<YbNotCodeMapper, YbNotCode> implements YbNotCodeService {
@Resource
private YbNotCodeMapper ybNotCodeMapper;
@Override
public List<YbNotCode> pageList(YbNotCodeQuery query) {
if (query.getPage() != null) {
PageHelper.startPage(query.getPage(), query.getLimit());
}
return ybNotCodeMapper.pageList(query);
}
@Override
public Boolean add(YbNotCode ybNotCode) {
return ybNotCodeMapper.insert(ybNotCode) > 0 ? true : false;
}
@Override
public Boolean update(YbNotCode ybNotCode) {
return ybNotCodeMapper.updateById(ybNotCode) > 0 ? true : false;
}
@Override
public Boolean delete(YbNotCode ybNotCode) {
return ybNotCodeMapper.deleteById(ybNotCode) > 0 ? true : false;
}
}

@ -12,69 +12,25 @@
<!--@mbg.generated-->
ybbm, organizationCode, notCodeType
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from yb_not_code
where ybbm = #{ybbm,jdbcType=VARCHAR}
<select id="pageList" resultType="com.glxp.api.entity.basic.YbNotCode">
select *,CASE
WHEN notCodeType = 1 THEN '部分早期未赋予追溯码'
WHEN notCodeType = 5 THEN '最小包装无追溯码'
WHEN notCodeType = 6 THEN '无追溯码'
WHEN notCodeType = 7 THEN '其他原因'
WHEN notCodeType = 0 THEN '默认不是无码类型'
ELSE '默认不是无码类型'
END AS notCodeTypeName from yb_not_code
<where>
<if test="vo.ybbm!=null and vo.ybbm!=''">
and ybbm = #{vo.ybbm}
</if>
<if test="vo.organizationCode!=null and vo.organizationCode!=''">
and organizationCode = #{vo.organizationCode}
</if>
<if test="vo.notCodeType!=null and vo.notCodeType!=-1">
and notCodeType = #{vo.notCodeType}
</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from yb_not_code
where ybbm = #{ybbm,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
insert into yb_not_code (ybbm, organizationCode, notCodeType
)
values (#{ybbm,jdbcType=VARCHAR}, #{organizationcode,jdbcType=VARCHAR}, #{notcodetype,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
insert into yb_not_code
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ybbm != null">
ybbm,
</if>
<if test="organizationcode != null">
organizationCode,
</if>
<if test="notcodetype != null">
notCodeType,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ybbm != null">
#{ybbm,jdbcType=VARCHAR},
</if>
<if test="organizationcode != null">
#{organizationcode,jdbcType=VARCHAR},
</if>
<if test="notcodetype != null">
#{notcodetype,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
update yb_not_code
<set>
<if test="organizationcode != null">
organizationCode = #{organizationcode,jdbcType=VARCHAR},
</if>
<if test="notcodetype != null">
notCodeType = #{notcodetype,jdbcType=VARCHAR},
</if>
</set>
where ybbm = #{ybbm,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
update yb_not_code
set organizationCode = #{organizationcode,jdbcType=VARCHAR},
notCodeType = #{notcodetype,jdbcType=VARCHAR}
where ybbm = #{ybbm,jdbcType=VARCHAR}
</update>
</mapper>
</mapper>

@ -5448,27 +5448,31 @@ CALL Pro_Temp_ColumnWork('io_collect_set', 'drugDealConfirm',
CALL Pro_Temp_ColumnWork('basic_udirel', 'manuReview',
'tinyint NULL DEFAULT b''0'' COMMENT ''是否已人工审核''', 1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'notCodeType',
' tinyint NULL DEFAULT b''0''COMMENT ''无码类型''',
' tinyint NULL DEFAULT b''0''COMMENT ''无码类型 0、默认不是无码类型1、部分早期未赋予追溯码5、最小包装无追溯码6、无追溯码7、其他原因''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'drugSellingPrice',
' decimal(10, 2) DEFAULT NULL COMMENT ''药品售价''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'drugSellingPriceTime',
' datetime DEFAULT NULL COMMENT ''药品售价''',
' datetime DEFAULT NULL COMMENT ''售价开始时间''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'hangingNetType',
' tinyint DEFAULT NULL COMMENT ''是否挂网''',
' tinyint DEFAULT NULL COMMENT ''是否挂网 0 否 1 是''',
1);
CREATE TABLE IF NOT EXISTS `yb_not_code` (
`ybbm` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '国家医保目录编码',
`organizationCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构编码',
`notCodeType` tinyint DEFAULT NULL COMMENT '无码类型 1、部分早期未赋予追溯码 5、最小包装无追溯码 6、无追溯码 7、其他原因 0、默认不是无码类型',
`notCodeType` tinyint DEFAULT NULL COMMENT '无码类型 0、默认不是无码类型1、部分早期未赋予追溯码5、最小包装无追溯码6、无追溯码7、其他原因',
PRIMARY KEY (`ybbm`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='医保无码信息表';

Loading…
Cancel
Save