Compare commits
No commits in common. "45683f82961173f24dd8a11be85024b4fe588013" and "40969ed18b49d8ff0b1c72490ad81b80c795830d" have entirely different histories.
45683f8296
...
40969ed18b
@ -1,38 +0,0 @@
|
|||||||
package com.czlis.liswork.controller.xtwh;
|
|
||||||
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.liswork.pojo.DTO.ComUsrpowerDTO;
|
|
||||||
import com.czlis.liswork.service.ComUsrpowerService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Api(tags = "数据操作权限")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/comUserpower")
|
|
||||||
@Slf4j
|
|
||||||
public class ComUsrpowerController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ComUsrpowerService comUsrpowerService;
|
|
||||||
|
|
||||||
@ApiOperation("获取仪器列表数据")
|
|
||||||
@GetMapping("/query")
|
|
||||||
public Result query(ComUsrpowerDTO comUsrpowerDTO){
|
|
||||||
return comUsrpowerService.query(comUsrpowerDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("保存数据")
|
|
||||||
@PostMapping("/add")
|
|
||||||
public Result add(List<ComUsrpowerDTO> comUsrpowerDTO){
|
|
||||||
return comUsrpowerService.add(comUsrpowerDTO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
package com.czlis.liswork.mapper.xtwh;
|
|
||||||
|
|
||||||
import com.czlis.liswork.pojo.DTO.ComUsrpowerDTO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface ComUsrpowerMapper {
|
|
||||||
List<ComUsrpowerDTO> query(ComUsrpowerDTO comUsrpowerDTO);
|
|
||||||
void insert(ComUsrpowerDTO comUsrpowerDTO);
|
|
||||||
void update(ComUsrpowerDTO comUsrpowerDTO);
|
|
||||||
void delete(ComUsrpowerDTO comUsrpowerDTO);
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
package com.czlis.liswork.pojo.DTO;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ComUsrpowerDTO {
|
|
||||||
private String yhdh;
|
|
||||||
private String yq;
|
|
||||||
private String xtdh;
|
|
||||||
private String yhqx;
|
|
||||||
private Integer role_id;
|
|
||||||
private String instr_yq;
|
|
||||||
private String yqmc;
|
|
||||||
private String syqx;
|
|
||||||
private String useflag;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
package com.czlis.liswork.service;
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.liswork.pojo.DTO.ComUsrpowerDTO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public interface ComUsrpowerService {
|
|
||||||
Result query(ComUsrpowerDTO comUsrpowerDTO);
|
|
||||||
|
|
||||||
Result add(List<ComUsrpowerDTO> comUsrpowerDTO);
|
|
||||||
}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
package com.czlis.liswork.service.impl.xtwh;
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.liswork.mapper.xtwh.ComUsrpowerMapper;
|
|
||||||
import com.czlis.liswork.pojo.DTO.ComUsrpowerDTO;
|
|
||||||
import com.czlis.liswork.service.ComUsrpowerService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ComUsrpowerServiceImpl implements ComUsrpowerService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ComUsrpowerMapper comUsrpowerMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result query(ComUsrpowerDTO comUsrpowerDTO) {
|
|
||||||
List<ComUsrpowerDTO> comUsrPowerList = comUsrpowerMapper.query(comUsrpowerDTO);
|
|
||||||
return new Result("0","获取数据成功!",comUsrPowerList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result add(List<ComUsrpowerDTO> comUsrpowerDTOList) {
|
|
||||||
for (ComUsrpowerDTO comUsrpowerDTO : comUsrpowerDTOList) {
|
|
||||||
String syqx = comUsrpowerDTO.getSyqx();
|
|
||||||
//有权限的
|
|
||||||
if(syqx.equals("1")){
|
|
||||||
String yhdh = comUsrpowerDTO.getYhdh();
|
|
||||||
String yq = comUsrpowerDTO.getYq();
|
|
||||||
String xtdh = comUsrpowerDTO.getXtdh();
|
|
||||||
if(yhdh == null) continue;
|
|
||||||
if(yq == null) continue;
|
|
||||||
if(xtdh == null) continue;
|
|
||||||
if(!xtdh.equals("LIS")) return new Result("-1","不是LIS类型的权限!");
|
|
||||||
List<ComUsrpowerDTO> comUsrpowerDTOOneList = comUsrpowerMapper.query(comUsrpowerDTO);
|
|
||||||
if(comUsrpowerDTOOneList.size() > 0){
|
|
||||||
comUsrpowerMapper.update(comUsrpowerDTO);
|
|
||||||
}else{
|
|
||||||
comUsrpowerMapper.insert(comUsrpowerDTO);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
//没有权限的
|
|
||||||
List<ComUsrpowerDTO> comUsrpowerDTOOneList = comUsrpowerMapper.query(comUsrpowerDTO);
|
|
||||||
if(comUsrpowerDTOOneList.size() > 0){
|
|
||||||
//之前有权限的,要去掉
|
|
||||||
comUsrpowerMapper.delete(comUsrpowerDTO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new Result("0","新增成功!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -29,6 +29,7 @@ public class LabCheckrulesServiceImpl implements LabCheckrulesService {
|
|||||||
@Override
|
@Override
|
||||||
public Result update(List<LabCheckrules> labCheckrulesList) {
|
public Result update(List<LabCheckrules> labCheckrulesList) {
|
||||||
for (LabCheckrules labCheckrules : labCheckrulesList) {
|
for (LabCheckrules labCheckrules : labCheckrulesList) {
|
||||||
|
LabCheckrules labCheckrules1 = new LabCheckrules();
|
||||||
if(labCheckrules.getRuleid() == null){
|
if(labCheckrules.getRuleid() == null){
|
||||||
labCheckrulesMapper.insert(labCheckrules);
|
labCheckrulesMapper.insert(labCheckrules);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
||||||
<mapper namespace="com.czlis.liswork.mapper.xtwh.ComUsrpowerMapper">
|
|
||||||
<select id="query" resultType="com.czlis.liswork.pojo.DTO.ComUsrpowerDTO">
|
|
||||||
select b.*,a.yq as instr_yq,a.yqmc,(case when isnull(b.yhdh,'') = '' then '0' else '1' end) as syqx,a.useflag from lab_instr a left join com_usrpower b on (a.yq = b.yq and b.yhdh = #{yhdh} and b.xtdh = 'LIS')
|
|
||||||
<where>
|
|
||||||
<if test="yq != null and yq = ''"> and yq = #{yq}</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id ="insert">
|
|
||||||
insert into com_usrpower (yhdh, yq, xtdh, yhqx)
|
|
||||||
values ( #{yhdh},#{yq},#{xtdh},#{yhqx})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update">
|
|
||||||
update com_usrpower set yhqx = #{yhqx} where yhdh = #{yhdh} and yq = #{yq} and xtdh = #{xtdh}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="delete">
|
|
||||||
delete from com_usrpower where yhdh = #{yhdh} and yq = #{yq} and xtdh = #{xtdh}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user