Compare commits
No commits in common. "master" and "wy" have entirely different histories.
@ -86,52 +86,45 @@ public class LisUtil {
|
|||||||
* 按GBK编码的字节宽度截取字符串,最多取cutlens个字节(避免截取半个汉字)
|
* 按GBK编码的字节宽度截取字符串,最多取cutlens个字节(避免截取半个汉字)
|
||||||
*
|
*
|
||||||
* @param str 原始字符串
|
* @param str 原始字符串
|
||||||
* @param beginidx 起始GBK字节偏移,从0开始
|
* @param beginidx 起始位置
|
||||||
* @param cutlens 需要截取的最大GBK字节长度
|
* @param cutlens 截取长度
|
||||||
* @return 截取后的字符串
|
* @return 截取后的字符串
|
||||||
*/
|
*/
|
||||||
public static String substringByGbkWidth(String str, int beginidx, int cutlens) {
|
public static String substringByGbkWidth(String str, int beginidx, int cutlens) {
|
||||||
if (str == null || str.isEmpty()) {
|
if (str == null || str.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (beginidx < 0 || cutlens <= 0) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
int skipBytes = beginidx; // 需要跳过的GBK字节数
|
int targetWidth = cutlens; // 目标字节宽度
|
||||||
int takeBytes = cutlens; // 需要截取的GBK字节数
|
int currentWidth = beginidx; // 当前累计字节宽度
|
||||||
int currentTake = 0;
|
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
|
|
||||||
for (char c : str.toCharArray()) {
|
for (char c : str.toCharArray()) {
|
||||||
|
// 计算当前字符在GBK编码下的字节数
|
||||||
int charWidth;
|
int charWidth;
|
||||||
try {
|
try {
|
||||||
|
// GBK编码中,汉字占2字节,英文等占1字节
|
||||||
charWidth = String.valueOf(c).getBytes("GBK").length;
|
charWidth = String.valueOf(c).getBytes("GBK").length;
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
// 理论上GBK是Java默认支持的编码,不会走到这里
|
||||||
throw new RuntimeException("不支持GBK编码", e);
|
throw new RuntimeException("不支持GBK编码", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 阶段1:还在跳过前置字节
|
// 判断加上当前字符后是否超过目标宽度
|
||||||
if (skipBytes > 0) {
|
if (currentWidth + charWidth > targetWidth) {
|
||||||
if (charWidth <= skipBytes) {
|
break; // 超过则停止,不截取当前字符
|
||||||
skipBytes -= charWidth;
|
|
||||||
} else {
|
|
||||||
// 当前字符跨起始边界,直接丢弃,不能切半个汉字
|
|
||||||
skipBytes = 0;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 阶段2:开始收集字符
|
// 未超过则累加宽度并添加字符
|
||||||
if (currentTake + charWidth > takeBytes) {
|
currentWidth += charWidth;
|
||||||
break;
|
|
||||||
}
|
|
||||||
currentTake += charWidth;
|
|
||||||
result.append(c);
|
result.append(c);
|
||||||
if (currentTake == takeBytes) {
|
|
||||||
|
// 如果刚好达到目标宽度,提前结束
|
||||||
|
if (currentWidth == targetWidth) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -210,11 +210,6 @@ public class ReportItemController extends BaseController {
|
|||||||
public Result getitemtdh(String yq){
|
public Result getitemtdh(String yq){
|
||||||
return reportItemService.getitemtdh(yq);
|
return reportItemService.getitemtdh(yq);
|
||||||
}
|
}
|
||||||
@ApiOperation("根据项目代号查询通道号")
|
|
||||||
@GetMapping("/queryTdhByXmdh")
|
|
||||||
public Result queryTdhByXmdh(String yq, String xmdh){
|
|
||||||
return reportItemService.queryTdhByXmdh(yq, xmdh);
|
|
||||||
}
|
|
||||||
@ApiOperation("保存检验项目通道号")
|
@ApiOperation("保存检验项目通道号")
|
||||||
@PostMapping("/saveitemtdh")
|
@PostMapping("/saveitemtdh")
|
||||||
public Result saveitemtdh(@RequestBody List<XmInter> XmInterList){
|
public Result saveitemtdh(@RequestBody List<XmInter> XmInterList){
|
||||||
|
|||||||
@ -63,12 +63,6 @@ public class XmReqitemVsReportitemController extends BaseController {
|
|||||||
return xmReqitemVsReportitemService.update(xmReqitemVsReportitem);
|
return xmReqitemVsReportitemService.update(xmReqitemVsReportitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询未对应收费项目")
|
|
||||||
@GetMapping("/queryUnmapped")
|
|
||||||
public Result queryUnmapped(String yq){
|
|
||||||
return xmReqitemVsReportitemService.queryUnmapped(yq);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = SysLogConstants.XMREQITEMVSREPORTITEM_LOG ,businessType = BusinessType.UPDATE)
|
@Log(title = SysLogConstants.XMREQITEMVSREPORTITEM_LOG ,businessType = BusinessType.UPDATE)
|
||||||
@ApiOperation("搜索项目")
|
@ApiOperation("搜索项目")
|
||||||
@GetMapping("/search")
|
@GetMapping("/search")
|
||||||
|
|||||||
@ -1,49 +0,0 @@
|
|||||||
package com.czlis.liswork.controller.xtwh;
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.XmMed;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.XmMedDetail;
|
|
||||||
import com.czlis.liswork.service.AntibioticBreakpointService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抗生素折点范围字典
|
|
||||||
*/
|
|
||||||
@Api(tags = "抗生素折点范围字典")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/xm")
|
|
||||||
public class AntibioticBreakpointController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private AntibioticBreakpointService antibioticBreakpointService;
|
|
||||||
|
|
||||||
@ApiOperation("获取菌属列表")
|
|
||||||
@GetMapping("/meddetail/germclass/list")
|
|
||||||
public Result getGermClassList() {
|
|
||||||
return antibioticBreakpointService.getGermClassList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("获取抗生素字典列表")
|
|
||||||
@GetMapping("/med/list")
|
|
||||||
public Result getAntibioticList(XmMed xmMed) {
|
|
||||||
return antibioticBreakpointService.getAntibioticList(xmMed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("获取折点范围数据")
|
|
||||||
@GetMapping("/breakpoint/list")
|
|
||||||
public Result getBreakpointList(@RequestParam String germClassCode) {
|
|
||||||
return antibioticBreakpointService.getBreakpointList(germClassCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("批量保存折点范围")
|
|
||||||
@PostMapping("/breakpoint/batch")
|
|
||||||
public Result batchSaveBreakpoint(@RequestBody List<XmMedDetail> breakpointList) {
|
|
||||||
return antibioticBreakpointService.batchSaveBreakpoint(breakpointList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -32,24 +32,4 @@ public interface LisWorkGermMapper {
|
|||||||
int changepatjyrq(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh")String ybh, @Param("jyrq1")Date jyrq1);
|
int changepatjyrq(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh")String ybh, @Param("jyrq1")Date jyrq1);
|
||||||
List<XmTextResult> getGermTextDict();
|
List<XmTextResult> getGermTextDict();
|
||||||
LabPat getLabPat(@Param("yq")String yq,@Param("ybh") String ybh);
|
LabPat getLabPat(@Param("yq")String yq,@Param("ybh") String ybh);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取菌属列表
|
|
||||||
*/
|
|
||||||
List<Map<String, Object>> getGermClassList();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取折点范围数据
|
|
||||||
*/
|
|
||||||
List<XmMedDetail> getBreakpointList(@Param("germClassCode") String germClassCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除折点范围
|
|
||||||
*/
|
|
||||||
int deleteBreakpoint(@Param("xmdh") String xmdh, @Param("ywdh") String ywdh);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 插入折点范围
|
|
||||||
*/
|
|
||||||
int insertBreakpoint(XmMedDetail detail);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,6 @@ public interface XmReqitemVsReportitemMapper {
|
|||||||
void update(XmReqitemVsReportitem xmReqitemVsReportitem);
|
void update(XmReqitemVsReportitem xmReqitemVsReportitem);
|
||||||
XmReqitemVsReportitem queryOne(XmReqitemVsReportitem xmReqitemVsReportitem);
|
XmReqitemVsReportitem queryOne(XmReqitemVsReportitem xmReqitemVsReportitem);
|
||||||
List<Map<String, Object>> queryList(XmReqitemVsReportitem xmReqitemVsReportitem);
|
List<Map<String, Object>> queryList(XmReqitemVsReportitem xmReqitemVsReportitem);
|
||||||
List<Map<String, Object>> queryUnmapped(@Param("yq") String yq);
|
|
||||||
String getSqxmdhOne(String yq);
|
String getSqxmdhOne(String yq);
|
||||||
void searchXmdh(String yq);
|
void searchXmdh(String yq);
|
||||||
|
|
||||||
|
|||||||
@ -1,33 +0,0 @@
|
|||||||
package com.czlis.liswork.service;
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.XmMed;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.XmMedDetail;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抗生素折点范围字典服务
|
|
||||||
*/
|
|
||||||
public interface AntibioticBreakpointService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取菌属列表
|
|
||||||
*/
|
|
||||||
Result getGermClassList();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取抗生素字典列表
|
|
||||||
*/
|
|
||||||
Result getAntibioticList(XmMed xmMed);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取折点范围数据
|
|
||||||
*/
|
|
||||||
Result getBreakpointList(String germClassCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量保存折点范围
|
|
||||||
*/
|
|
||||||
Result batchSaveBreakpoint(List<XmMedDetail> breakpointList);
|
|
||||||
}
|
|
||||||
@ -60,7 +60,6 @@ public interface ReportItemService {
|
|||||||
|
|
||||||
Result updateXminfoVsDYXH(List<XmInfoVs> list);
|
Result updateXminfoVsDYXH(List<XmInfoVs> list);
|
||||||
Result getitemtdh(String yq);
|
Result getitemtdh(String yq);
|
||||||
Result queryTdhByXmdh(String yq, String xmdh);
|
|
||||||
Result saveitemtdh(List<XmInter> list);
|
Result saveitemtdh(List<XmInter> list);
|
||||||
Result delitemtdh(String yq,String tdh);
|
Result delitemtdh(String yq,String tdh);
|
||||||
Result getdouble(String yq ,String xmdh);
|
Result getdouble(String yq ,String xmdh);
|
||||||
|
|||||||
@ -13,7 +13,5 @@ public interface XmReqitemVsReportitemService {
|
|||||||
|
|
||||||
Result queryList(XmReqitemVsReportitem xmReqitemVsReportitem);
|
Result queryList(XmReqitemVsReportitem xmReqitemVsReportitem);
|
||||||
|
|
||||||
Result queryUnmapped(String yq);
|
|
||||||
|
|
||||||
Result searchXmdh(String yq);
|
Result searchXmdh(String yq);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,61 +0,0 @@
|
|||||||
package com.czlis.liswork.service.impl;
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.XmMed;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.XmMedDetail;
|
|
||||||
import com.czlis.liswork.mapper.LisWorkGermMapper;
|
|
||||||
import com.czlis.liswork.mapper.xtwh.XmMedMapper;
|
|
||||||
import com.czlis.liswork.service.AntibioticBreakpointService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抗生素折点范围字典服务实现
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class AntibioticBreakpointServiceImpl implements AntibioticBreakpointService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LisWorkGermMapper lisWorkGermMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private XmMedMapper xmMedMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result getGermClassList() {
|
|
||||||
List<Map<String, Object>> germClassList = lisWorkGermMapper.getGermClassList();
|
|
||||||
return new Result("0", "成功", germClassList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result getAntibioticList(XmMed xmMed) {
|
|
||||||
List<XmMed> antibioticList = xmMedMapper.queryList(xmMed);
|
|
||||||
return new Result("0", "成功", antibioticList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result getBreakpointList(String germClassCode) {
|
|
||||||
List<XmMedDetail> breakpointList = lisWorkGermMapper.getBreakpointList(germClassCode);
|
|
||||||
return new Result("0", "成功", breakpointList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public Result batchSaveBreakpoint(List<XmMedDetail> breakpointList) {
|
|
||||||
try {
|
|
||||||
for (XmMedDetail detail : breakpointList) {
|
|
||||||
// 先删除旧数据
|
|
||||||
lisWorkGermMapper.deleteBreakpoint(detail.getXmdh(), detail.getYwdh());
|
|
||||||
// 再插入新数据
|
|
||||||
lisWorkGermMapper.insertBreakpoint(detail);
|
|
||||||
}
|
|
||||||
return new Result("0", "保存成功");
|
|
||||||
} catch (Exception e) {
|
|
||||||
return new Result("-1", "保存失败:" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -446,13 +446,6 @@ public class ReportItemServiceImpl implements ReportItemService {
|
|||||||
return new Result("0","成功!",reportItemMapper.queryXmInter(xmInter));
|
return new Result("0","成功!",reportItemMapper.queryXmInter(xmInter));
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public Result queryTdhByXmdh(String yq, String xmdh){
|
|
||||||
XmInter xmInter=new XmInter();
|
|
||||||
xmInter.setYq(yq);
|
|
||||||
xmInter.setXmdh(xmdh);
|
|
||||||
return new Result("0","成功!",reportItemMapper.queryXmInter(xmInter));
|
|
||||||
}
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Result delitemtdh(String yq,String tdh){
|
public Result delitemtdh(String yq,String tdh){
|
||||||
|
|||||||
@ -69,11 +69,6 @@ public class XmReqitemVsReportitemImpl implements XmReqitemVsReportitemService {
|
|||||||
return new Result("0","获取数据成功!",xmReqitemVsReportitemList);
|
return new Result("0","获取数据成功!",xmReqitemVsReportitemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result queryUnmapped(String yq) {
|
|
||||||
return new Result("0","获取数据成功!",xmReqitemVsReportitemMapper.queryUnmapped(yq));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result searchXmdh(String yq) {
|
public Result searchXmdh(String yq) {
|
||||||
String sqxmdhOne = xmReqitemVsReportitemMapper.getSqxmdhOne(yq);
|
String sqxmdhOne = xmReqitemVsReportitemMapper.getSqxmdhOne(yq);
|
||||||
|
|||||||
@ -165,34 +165,4 @@
|
|||||||
<select id="getLabPat" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
|
<select id="getLabPat" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
|
||||||
select top 1 * from lab_pat where yq = #{yq} and ybh = #{ybh}
|
select top 1 * from lab_pat where yq = #{yq} and ybh = #{ybh}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 获取菌属列表 -->
|
|
||||||
<select id="getGermClassList" resultType="java.util.Map">
|
|
||||||
SELECT zdlb, zddh, zdmc, zjf
|
|
||||||
FROM com_dict
|
|
||||||
WHERE zdlb = 'germclass'
|
|
||||||
AND (userflag != '1' OR userflag IS NULL)
|
|
||||||
ORDER BY zddh
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 获取折点范围数据 -->
|
|
||||||
<select id="getBreakpointList" resultType="com.czlis.common.core.domain.entity.lis.XmMedDetail">
|
|
||||||
SELECT d.*, m.ywmc as medName
|
|
||||||
FROM xm_meddetail d
|
|
||||||
LEFT JOIN xm_med m ON d.ywdh = m.ywdh
|
|
||||||
WHERE d.xmdh = #{germClassCode}
|
|
||||||
AND d.ywzmc = N'菌属'
|
|
||||||
ORDER BY d.xh
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 删除折点范围 -->
|
|
||||||
<delete id="deleteBreakpoint">
|
|
||||||
DELETE FROM xm_meddetail WHERE xmdh = #{xmdh} AND ywdh = #{ywdh} AND ywzmc = N'菌属'
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<!-- 插入折点范围 -->
|
|
||||||
<insert id="insertBreakpoint">
|
|
||||||
INSERT INTO xm_meddetail (yq, xmdh, ywzmc, ywdh, mic1, mic2, rad1, rad2, mrz, xh, bz, micref, radref, sddfalg)
|
|
||||||
VALUES (#{yq}, #{xmdh}, #{ywzmc}, #{ywdh}, #{mic1}, #{mic2}, #{rad1}, #{rad2}, #{mrz}, #{xh}, #{bz}, #{micref}, #{radref}, #{sddfalg})
|
|
||||||
</insert>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -80,11 +80,4 @@
|
|||||||
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="queryUnmapped">
|
|
||||||
select xm_feeinstr.yq, xm_feeinstr.sfxmdh as sqxmdh, xm_fee.sfxmmc as sqxmmc
|
|
||||||
from xm_feeinstr join xm_fee on xm_feeinstr.sfxmdh = xm_fee.sfxmdh
|
|
||||||
where xm_feeinstr.yq = #{yq}
|
|
||||||
and xm_feeinstr.sfxmdh not in (select distinct sqxmdh from dbo.xm_reqitem_vs_reportitem where yq = #{yq})
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user