Commit e8f51016 authored by 竹天卫's avatar 竹天卫
parents 6664730a 363932a7
......@@ -58,9 +58,7 @@ public class PrecipriceController {
@ApiOperation("aaa")
public void add(){
iNormProductionService.createPreciprice(1,1,1,1,1);
iNormProductionService.createPreciprice(1,1,20,0,1);
iNormProductionService.createPreciprice(1,1,1,1,1);
iNormProductionService.createPreciprice(1,1,1,1,1);
}
@GetMapping("/statistics")
......
......@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* <p>
......@@ -32,4 +33,11 @@ public interface EquipmentUseMapper extends BaseMapper<EquipmentUse> {
* @return list
*/
List<String> getEquipmentNamesByProjectId(@Param("param") Integer entrustId);
/**
* 根据设备ids获取使用到的设备名字
* @param ids 设备id
* @return list
*/
List<String> getEquipmentNamesByEquipmentIds(@Param("params")Set<Integer> ids);
}
......@@ -52,5 +52,13 @@
WHERE eu.id IS NOT NULL
</select>
<select id="getEquipmentNamesByEquipmentIds" resultType="java.lang.String">
SELECT CONCAT(`name`,' (',`code`,')') FROM equipment
where id in
<foreach collection="params" open="(" close=")" item="id" separator=",">
#{id}
</foreach>
</select>
</mapper>
......@@ -2655,7 +2655,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts.setSampleNames(new HashSet<>(source.size()));
rts.setMethodNames(new HashSet<>(source.size()));
rts.setTeamNames(new HashSet<>(source.size()));
Set<Integer> equipmentIds = new HashSet<>(source.size());
source.forEach(arg -> {
equipmentIds.add(arg.getEquipmentId());
//获取使用的设备id
//关联检测项目
if (StrUtil.isNotBlank(arg.getTeamName())) {
String[] teamSplits = arg.getTeamName().split("、");
......@@ -2679,7 +2682,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts.setSampleNum(rts.getSampleNames().size());
//关联仪器名字 去重
List<String> equipmentNames = equipmentUseMapper.getEquipmentNamesByProjectId(firstReportDetail.getEntrustId());
List<String> equipmentNames = equipmentUseMapper.getEquipmentNamesByEquipmentIds(equipmentIds);
equipmentNames.forEach(arg -> rts.getEquipmentNames().add(arg));
//关联送样单位名字
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment