Compare commits

...

2 Commits

Author SHA1 Message Date
tangw
edd34c62a7 Merge remote-tracking branch 'origin/master' 2025-12-12 18:07:50 +08:00
tangw
f9393c970c 参数模块 2025-12-12 18:07:13 +08:00
9 changed files with 28 additions and 62 deletions

View File

@ -2,4 +2,5 @@ package com.czlis.interfaceCommon.mapper;
public interface ComLocalconfigMapper { public interface ComLocalconfigMapper {
String getLocalconfig(String smac); String getLocalconfig(String smac);
String getLocalconfigByIP(String ip);
} }

View File

@ -666,7 +666,9 @@ public class CommonUtil {
public String getLocalconfig(String smac) { public String getLocalconfig(String smac) {
return comLocalconfigMapper.getLocalconfig(smac); return comLocalconfigMapper.getLocalconfig(smac);
} }
public String getLocalconfigByIP(String ip) {
return comLocalconfigMapper.getLocalconfigByIP(ip);
}
public SysUser getSysUserOne(String user_name){ public SysUser getSysUserOne(String user_name){
return sysUserCommMapper.getSysUserOne(user_name); return sysUserCommMapper.getSysUserOne(user_name);
} }

View File

@ -5,4 +5,7 @@
<select id="getLocalconfig" resultType="String"> <select id="getLocalconfig" resultType="String">
select configvalue from com_localconfig where smac = #{smac} select configvalue from com_localconfig where smac = #{smac}
</select> </select>
<select id="getLocalconfigByIP" resultType="String">
select configvalue from com_localconfig where sip = #{ip}
</select>
</mapper> </mapper>

View File

@ -7,7 +7,7 @@ import com.czlis.common.core.domain.entity.SysUser;
import com.czlis.common.core.domain.model.LoginBody; import com.czlis.common.core.domain.model.LoginBody;
import com.czlis.common.core.domain.model.LoginUser; import com.czlis.common.core.domain.model.LoginUser;
import com.czlis.common.utils.SecurityUtils; import com.czlis.common.utils.SecurityUtils;
import com.czlis.interfaceCommon.mapper.ComDictMapper; import com.czlis.common.utils.ip.IpUtils;
import com.czlis.system.service.ISysMenuService; import com.czlis.system.service.ISysMenuService;
import com.czlis.system.web.service.SysLoginService; import com.czlis.system.web.service.SysLoginService;
import com.czlis.system.web.service.SysPermissionService; import com.czlis.system.web.service.SysPermissionService;
@ -20,9 +20,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**
@ -100,8 +98,8 @@ public class SysLoginController {
/** /**
* 单点登录 * 单点登录
* @param loginBody * @param loginBody 入参集合
* @return * @return 返回令牌和用户信息
*/ */
@PostMapping("/loginAnonymous") @PostMapping("/loginAnonymous")
public AjaxResult loginAnonymous(@RequestBody LoginBody loginBody) { public AjaxResult loginAnonymous(@RequestBody LoginBody loginBody) {
@ -115,13 +113,13 @@ public class SysLoginController {
/** /**
* 获取客户端本地配置 * 获取客户端本地配置
* @param localid * @param localid 浏览器指纹
* @return * @return 返回初始化信息
*/ */
@GetMapping("/getLocalconfig") @GetMapping("/getLocalconfig")
public AjaxResult getLocalconfig(String localid) { public AjaxResult getLocalconfig(String localid) {
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
ajax.put("localconfig", loginService.getLocalconfig(localid)); ajax.put("localconfig", loginService.getLocalconfig(localid,IpUtils.getIpAddr()));
ajax.put("oem", loginService.getOEM()); ajax.put("oem", loginService.getOEM());
ajax.put("hosplist", loginService.gethospList()); ajax.put("hosplist", loginService.gethospList());
return ajax; return ajax;

View File

@ -66,8 +66,11 @@ public class SysLoginService {
@Autowired @Autowired
private SysUserMapper userMapper; private SysUserMapper userMapper;
public Map<String, Object> getLocalconfig(String smac){ public Map<String, Object> getLocalconfig(String smac,String ip){
String configvalue=commonUtil.getLocalconfig(smac); String configvalue=commonUtil.getLocalconfig(smac);
if(configvalue==null&&!"127.0.0.1".equals(ip)&&ip!=null) {
configvalue=commonUtil.getLocalconfigByIP(ip);
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if(configvalue!=null) { if(configvalue!=null) {
map = JSON.parseObject(configvalue, Map.class); map = JSON.parseObject(configvalue, Map.class);

View File

@ -35,8 +35,8 @@ public class ComOptController extends BaseController {
@ApiOperation("查询参数列表") @ApiOperation("查询参数列表")
@GetMapping("/query") @GetMapping("/query")
public Result getComOptList(String yq) { public Result getComOptList(String yq,String optiontype) {
return comOptService.getComOptList(yq); return comOptService.getComOptList(yq,optiontype);
} }
@ApiOperation("整体保存本地参数") @ApiOperation("整体保存本地参数")
@Log(title = "整体保存本地参数", businessType = BusinessType.UPDATE) @Log(title = "整体保存本地参数", businessType = BusinessType.UPDATE)
@ -52,8 +52,8 @@ public class ComOptController extends BaseController {
} }
@ApiOperation("查询参数默认值") @ApiOperation("查询参数默认值")
@GetMapping("/getdef") @GetMapping("/getdef")
public Result getdef(){ public Result getdef(String optiontype){
return comOptService.getdef(); return comOptService.getdef(optiontype);
} }
} }

View File

@ -8,8 +8,8 @@ import com.czlis.common.core.domain.entity.lis.ComOptTemplate;
import java.util.List; import java.util.List;
public interface ComOptService { public interface ComOptService {
Result getComOptList(String yq); Result getComOptList(String yq,String optiontype);
Result saveopt(List<ComConfigDict> posts); Result saveopt(List<ComConfigDict> posts);
Result queryTree(); Result queryTree();
Result getdef(); Result getdef(String optiontype);
} }

View File

@ -27,16 +27,16 @@ public class ComOptServiceImpl implements ComOptService {
@Autowired @Autowired
private CommonUtil commonUtil; private CommonUtil commonUtil;
@Override @Override
public Result getdef(){ public Result getdef(String optiontype){
List<ComConfigDict> list=getconfigdef(ConfigTypeConstants.SYSTEM); List<ComConfigDict> list=getconfigdef(optiontype);
return new Result("0","成功",list); return new Result("0","成功",list);
} }
@Override @Override
public Result getComOptList(String yq) { public Result getComOptList(String yq,String optiontype) {
ComOpt comOpt=new ComOpt(); ComOpt comOpt=new ComOpt();
comOpt.setYq(yq); comOpt.setYq(yq);
List<ComOpt> comOptList = comOptMapper.getComOptList(comOpt); List<ComOpt> comOptList = comOptMapper.getComOptList(comOpt);
List<ComConfigDict> list=getconfigdef(ConfigTypeConstants.SYSTEM); List<ComConfigDict> list=getconfigdef(optiontype);
if(list.isEmpty()||list==null)return new Result("","",list); if(list.isEmpty()||list==null)return new Result("","",list);
for(ComConfigDict comConfigDict:list){ for(ComConfigDict comConfigDict:list){
comConfigDict.setYq(yq); comConfigDict.setYq(yq);

View File

@ -55,53 +55,12 @@ begin
alter table sys_user add snid1 varchar(50) alter table sys_user add snid1 varchar(50)
end end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_opt_template')
begin
create table com_opt_template
(
id bigint identity(1,1),
opttype varchar(10) not null, -- 1.单选框,2.文本框,3.下拉框
comtype varchar(100) not null, --1._BAR_ ,_BLDCK,_BLDIN,
optcode varchar(100) not null, --参数名称
optdefault varchar(100), --默认值
optSort int, --排序
scope varchar(1000), --阈值
bz varchar(500)
);
ALTER TABLE com_opt_template
ADD CONSTRAINT PK_com_opt_template PRIMARY KEY CLUSTERED (comtype,optcode);
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_opt' AND COLUMN_NAME = 'opttype')
begin
alter table com_opt add opttype varchar(10)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_opt' AND COLUMN_NAME = 'scope')
begin
alter table com_opt add scope varchar(100)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_opt' AND COLUMN_NAME = 'optSort')
begin
alter table com_opt add optSort int
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_opt' AND COLUMN_NAME = 'status')
begin
alter table com_opt add status varchar(10)
end
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'com_opt' AND COLUMN_NAME = 'lx')
begin
alter table com_opt add lx varchar(10)
end
if not exists(select 1 from com_opt where yq = '' and xxdh = 'A5MERGEA4') if not exists(select 1 from com_opt where yq = '' and xxdh = 'A5MERGEA4')
begin begin
insert into com_opt(yq,xxdh,xxlb,xxqz,bz,lx) values('','A5MERGEA4','SYS','0','A5报告单是否合并成A4打印','1') insert into com_opt(yq,xxdh,xxlb,xxqz,bz) values('','A5MERGEA4','SYS','0','A5报告单是否合并成A4打印')
end end
--报告单仪器对应表 --报告单仪器对应表