1、无码信息申报
							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> { | ||||
| } | ||||
| @ -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; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue