界面调整
This commit is contained in:
parent
d8dfa69399
commit
884d9432dd
@ -1,9 +1,15 @@
|
|||||||
package com.czlis.interfaceCommon.mapper;
|
package com.czlis.interfaceCommon.mapper;
|
||||||
|
|
||||||
import com.czlis.common.core.domain.entity.lis.LabInputcol;
|
import com.czlis.common.core.domain.entity.lis.LabInputcol;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface LabInputcolMapper {
|
public interface LabInputcolMapper {
|
||||||
List<LabInputcol> getLabInputcol(String yq);
|
List<LabInputcol> getLabInputcol(String yq);
|
||||||
|
List<LabInputcol> getLabInputcolNEW();
|
||||||
|
int insertLabInputcol(LabInputcol labInputcol);
|
||||||
|
int updateLabInputcol(LabInputcol labInputcol);
|
||||||
|
int getcount(@Param("yq") String yq,@Param("zdmc") String zdmc);
|
||||||
|
int deleteLabInputcol(@Param("yq") String yq,@Param("zdmc") String zdmc);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,25 @@
|
|||||||
<select id="getLabInputcol" resultType="com.czlis.common.core.domain.entity.lis.LabInputcol">
|
<select id="getLabInputcol" resultType="com.czlis.common.core.domain.entity.lis.LabInputcol">
|
||||||
SELECT * FROM lab_inputcol where yq = #{yq} order by xh ASC
|
SELECT * FROM lab_inputcol where yq = #{yq} order by xh ASC
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getLabInputcolNEW" resultType="com.czlis.common.core.domain.entity.lis.LabInputcol">
|
||||||
|
SELECT yq, zdmc, zdts, mrts,'1' as kybj, '0' as zdjy, '' as mrz,'1' as kj,xh FROM lab_inputcol where yq =(SELECT min(yq) FROM lab_inputcol) order by xh ASC
|
||||||
|
</select>
|
||||||
|
<select id="getcount" resultType="int">
|
||||||
|
select count(1) from lab_inputcol WHERE yq = #{yq} and zdmc = #{zdmc}
|
||||||
|
</select>
|
||||||
|
<insert id="insertLabInputcol">
|
||||||
|
INSERT INTO lab_inputcol (yq, zdmc, zdts, mrts,kybj, zdjy, mrz, kj,xh)
|
||||||
|
values(#{yq},#{zdmc},#{zdts},#{mrts},#{kybj},#{zdjy},#{mrz},#{kj},#{xh})
|
||||||
|
</insert>
|
||||||
|
<insert id="deleteLabInputcol">
|
||||||
|
delete from lab_inputcol WHERE yq = #{yq} and zdmc = #{zdmc}
|
||||||
|
</insert>
|
||||||
|
<update id="updateLabInputcol">
|
||||||
|
update lab_inputcol
|
||||||
|
set zdts=#{zdts} ,mrts=#{mrts} ,kybj=#{kybj} ,zdjy=#{zdjy} ,mrz=#{mrz} ,
|
||||||
|
kj=#{kj} ,xh=#{xh}
|
||||||
|
WHERE yq = #{yq} and zdmc = #{zdmc}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.czlis.liswork.controller.xtwh;
|
||||||
|
|
||||||
|
import com.czlis.common.annotation.Log;
|
||||||
|
import com.czlis.common.core.controller.BaseController;
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabInputcol;
|
||||||
|
import com.czlis.common.enums.BusinessType;
|
||||||
|
import com.czlis.liswork.service.LabInputcolService;
|
||||||
|
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.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "仪器界面调整")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inputcol")
|
||||||
|
@Slf4j
|
||||||
|
public class LabInputcolController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private LabInputcolService labInputcolService;
|
||||||
|
|
||||||
|
@ApiOperation("查询调整列表")
|
||||||
|
@GetMapping("/query")
|
||||||
|
public Result getLabInputcolList(String yq) {
|
||||||
|
return labInputcolService.getLabInputcolList(yq);
|
||||||
|
}
|
||||||
|
@ApiOperation("整体调整列表")
|
||||||
|
@Log(title = "整体调整列表", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/save")
|
||||||
|
public Result saveLabInputcol(@Validated @RequestBody List<LabInputcol> posts) {
|
||||||
|
return labInputcolService.saveLabInputcol(posts) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.czlis.liswork.service;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabInputcol;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface LabInputcolService {
|
||||||
|
Result getLabInputcolList(String yq);
|
||||||
|
Result saveLabInputcol(List<LabInputcol> posts);
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
package com.czlis.liswork.service.impl.xtwh;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabInputcol;
|
||||||
|
import com.czlis.interfaceCommon.mapper.LabInputcolMapper;
|
||||||
|
import com.czlis.liswork.service.LabInputcolService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class LabInputcolServiceImpl implements LabInputcolService {
|
||||||
|
@Autowired
|
||||||
|
private LabInputcolMapper labInputcolMapper;
|
||||||
|
@Override
|
||||||
|
public Result getLabInputcolList(String yq){
|
||||||
|
if(yq==null||"".equals(yq))return new Result("-1","仪器空,查询失败");
|
||||||
|
List<LabInputcol> labInputcollist=labInputcolMapper.getLabInputcol(yq);
|
||||||
|
if(labInputcollist==null||labInputcollist.size()==0){
|
||||||
|
labInputcollist=labInputcolMapper.getLabInputcolNEW();
|
||||||
|
}
|
||||||
|
for(LabInputcol labInputcol:labInputcollist){
|
||||||
|
String zdmc= labInputcol.getZdmc();
|
||||||
|
switch (zdmc){
|
||||||
|
case "brly":
|
||||||
|
labInputcol.setDict("PT");
|
||||||
|
break;
|
||||||
|
case "brxb":
|
||||||
|
labInputcol.setDict("SX");
|
||||||
|
break;
|
||||||
|
case "fb":
|
||||||
|
labInputcol.setDict("FT");
|
||||||
|
break;
|
||||||
|
case "hdys":
|
||||||
|
case "yhdh":
|
||||||
|
labInputcol.setDict("USR");
|
||||||
|
break;
|
||||||
|
case "ksdh":
|
||||||
|
labInputcol.setDict("DP");
|
||||||
|
break;
|
||||||
|
case "yblx":
|
||||||
|
labInputcol.setDict("BT");
|
||||||
|
break;
|
||||||
|
case "nldw":
|
||||||
|
labInputcol.setDict("AU");
|
||||||
|
break;
|
||||||
|
case "sjys":
|
||||||
|
labInputcol.setDict("SRD");
|
||||||
|
break;
|
||||||
|
case "slzq":
|
||||||
|
labInputcol.setDict("SLZQ");
|
||||||
|
break;
|
||||||
|
case "ybzt":
|
||||||
|
labInputcol.setDict("ST");
|
||||||
|
break;
|
||||||
|
case "cjbw":
|
||||||
|
labInputcol.setDict("CJBW");
|
||||||
|
break;
|
||||||
|
case "zjlx":
|
||||||
|
labInputcol.setDict("ZJLX");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new Result("0","成功",labInputcollist);
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public Result saveLabInputcol(List<LabInputcol> posts){
|
||||||
|
if(posts==null||posts.size()==0)return new Result("-1","列表为空保存失败");
|
||||||
|
for(LabInputcol labInputcol:posts) {
|
||||||
|
String yq=labInputcol.getYq();
|
||||||
|
String zdmc = labInputcol.getZdmc();
|
||||||
|
if("sqsj".equals(zdmc)||"dysj".equals(zdmc))labInputcol.setMrz("1");
|
||||||
|
if(labInputcolMapper.getcount(yq,zdmc)==1){
|
||||||
|
labInputcolMapper.updateLabInputcol(labInputcol);
|
||||||
|
}else {
|
||||||
|
labInputcolMapper.insertLabInputcol(labInputcol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Result("0","成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user