Commit 74f3336c authored by lisong's avatar lisong

修改sequenceCode重复报错bug

parent c576d50d
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.*;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderInfo;
import java.util.List;
import java.util.Map;
/**
* 气瓶基本信息 Mapper 接口
......@@ -20,13 +21,13 @@ public interface TzCylinderMapper extends BaseMapper<CylinderInfo> {
TzCylinderInfoDto getTzCylinderInfoDto(String sequenceNbr);
String getSequencCode(String sequenceNbr);
Map<String, Object> getSequencCode(String sequenceNbr);
TzCylinderProduceDto getTzCylinderProduceDto(String SequenceCode);
TzCylinderProduceDto getTzCylinderProduceDto(String sequenceCode, String appId);
TzCylinderTagsDto getTzCylinderTagsDto(String sequenceCode);
TzCylinderTagsDto getTzCylinderTagsDto(String sequenceCode, String appId);
List<TzCylinderInspectionDto> getTzCylinderInspectionDto(String sequenceCode);
List<TzCylinderInspectionDto> getTzCylinderInspectionDto(String sequenceCode, String appId);
List<TzCylinderFillingDto> getTzCylinderFillingDto(String sequenceCode);
......
......@@ -96,8 +96,8 @@
WHERE CI.sequence_nbr = #{sequenceNbr}
</select>
<select id="getSequencCode" resultType="java.lang.String">
SELECT sequence_code FROM tz_cylinder_info WHERE sequence_nbr=#{sequenceNbr}
<select id="getSequencCode" resultType="java.util.Map">
SELECT sequence_code, app_id FROM tz_cylinder_info WHERE sequence_nbr=#{sequenceNbr}
</select>
<select id="getTzCylinderProduceDto" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.TzCylinderProduceDto">
......@@ -114,7 +114,7 @@
CI.type_experiments
FROM
tz_cylinder_info CI
WHERE CI.sequence_code =#{SequenceCode}
WHERE CI.sequence_code =#{sequenceCode} and CI.app_id = #{appId}
</select>
<select id="getTzCylinderTagsDto" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.TzCylinderTagsDto">
......@@ -125,7 +125,7 @@
CT.electronic_label_code,
CT.gas_cylinder_stamp
FROM tz_cylinder_tags CT
WHERE CT.sequence_code = #{SequenceCode}
WHERE CT.sequence_code = #{sequenceCode} and CT.app_id = #{appId}
</select>
<select id="getTzCylinderInspectionDto" resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.dto.TzCylinderInspectionDto">
......@@ -138,7 +138,7 @@
CI.scrap_quantity,
CI.next_inspection_date
FROM tz_cylinder_inspection CI
WHERE CI.sequence_code = #{SequenceCode}
WHERE CI.sequence_code = #{sequenceCode} and CI.app_id = #{appId}
ORDER BY CI.inspection_date DESC
</select>
......
......@@ -59,8 +59,10 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
@Override
public TzCylinderTraceDto getCylinderTraceDto(String sequenceNbr) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String orgCode = tzCylinderMapper.getSequencCode(sequenceNbr);
TzCylinderProduceDto tzCylinderProduceDto = tzCylinderMapper.getTzCylinderProduceDto(orgCode);
Map<String, Object> cylinder = tzCylinderMapper.getSequencCode(sequenceNbr);
String appId = String.valueOf(cylinder.get("app_id"));
String sequenceCode = String.valueOf(cylinder.get("sequence_code"));
TzCylinderProduceDto tzCylinderProduceDto = tzCylinderMapper.getTzCylinderProduceDto(sequenceCode, appId);
if(!ValidationUtil.isEmpty(tzCylinderProduceDto.getManufacturingDate())) {
if(tzCylinderProduceDto.getManufacturingDate().length()>10) {
tzCylinderProduceDto.setManufacturingDate(tzCylinderProduceDto.getManufacturingDate().substring(0,10));
......@@ -95,15 +97,15 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
DataDictionary data3 = iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>()
.eq(DataDictionary::getSequenceNbr, tzCylinderInfoDto.getCylinderStatus()));
tzCylinderInfoDto.setCylinderStatus(data3 != null ? data3.getName() : null);
TzCylinderTagsDto tzCylinderTagsDto = tzCylinderMapper.getTzCylinderTagsDto(orgCode);
TzCylinderTagsDto tzCylinderTagsDto = tzCylinderMapper.getTzCylinderTagsDto(sequenceCode, appId);
if ( !ValidationUtil.isEmpty(tzCylinderTagsDto) && !ValidationUtil.isEmpty(tzCylinderTagsDto.getGasCylinderStamp())) {
tzCylinderTagsDto.setGasCylinderStamp(tzCylinderTagsDto.getGasCylinderStamp());
}
List<TzCylinderInspectionDto> tzCylinderInspectionDtoList = tzCylinderMapper
.getTzCylinderInspectionDto(orgCode);
List<TzCylinderFillingDto> tzCylinderFillingDtoList = tzCylinderMapper.getTzCylinderFillingDto(orgCode);
.getTzCylinderInspectionDto(sequenceCode, appId);
List<TzCylinderFillingDto> tzCylinderFillingDtoList = tzCylinderMapper.getTzCylinderFillingDto(sequenceCode);
/**
* 取气瓶追溯详情 充装前检查项 名称和结果列表
......@@ -183,9 +185,12 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
public CylinderFileUrlDto getFileUrlAndName(String sequenceNbr){
String orgCode = tzCylinderMapper.getSequencCode(sequenceNbr);
TzCylinderProduceDto tzCylinderProduceDto = tzCylinderMapper.getTzCylinderProduceDto(orgCode);
TzCylinderTagsDto tzCylinderTagsDto = tzCylinderMapper.getTzCylinderTagsDto(orgCode);
Map<String, Object> cylinder = tzCylinderMapper.getSequencCode(sequenceNbr);
String appId = String.valueOf(cylinder.get("app_id"));
String sequenceCode = String.valueOf(cylinder.get("sequence_code"));
TzCylinderProduceDto tzCylinderProduceDto = tzCylinderMapper.getTzCylinderProduceDto(sequenceCode, appId);
TzCylinderTagsDto tzCylinderTagsDto = tzCylinderMapper.getTzCylinderTagsDto(sequenceCode, appId);
CylinderFileUrlDto dto =new CylinderFileUrlDto();
if (!ValidationUtil.isEmpty(tzCylinderProduceDto)) {
if (!ValidationUtil.isEmpty(tzCylinderProduceDto.getProductQualified())) {
......
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