代码提交
This commit is contained in:
@@ -66,10 +66,10 @@ public class CsEquipmentDeliveryDTO {
|
||||
*/
|
||||
private String devAccessMethod;
|
||||
|
||||
// /**
|
||||
// * 装置程序版本
|
||||
// */
|
||||
// private String programVersion;
|
||||
/**
|
||||
* 装置程序版本
|
||||
*/
|
||||
private String programVersionName;
|
||||
|
||||
/**
|
||||
* 调试人员
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceManagerVO;
|
||||
import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
||||
import com.njcn.csdevice.service.CsDevModelRelationService;
|
||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.csdevice.service.IMqttUserService;
|
||||
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
||||
@@ -57,6 +58,7 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||
|
||||
private final IMqttUserService mqttUserService;
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addEquipmentDelivery")
|
||||
@@ -141,6 +143,8 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
List<CsEquipmentDeliveryDTO> collect = csEquipmentDeliveryPOS.stream().map(temp -> {
|
||||
CsEquipmentDeliveryDTO csEquipmentDeliveryDTO = new CsEquipmentDeliveryDTO();
|
||||
BeanUtils.copyProperties(temp, csEquipmentDeliveryDTO);
|
||||
String versionByDevId = csDevModelRelationService.getVersionByDevId(temp.getId());
|
||||
csEquipmentDeliveryDTO.setProgramVersionName(versionByDevId);
|
||||
return csEquipmentDeliveryDTO;
|
||||
}).collect(Collectors.toList());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, collect, methodDescribe);
|
||||
|
||||
@@ -17,4 +17,5 @@ public interface CsDevModelRelationMapper extends BaseMapper<CsDevModelRelationP
|
||||
|
||||
String getModelByType(@Param("devId") String devId, @Param("type") Integer type);
|
||||
|
||||
String getVersionByDevId(@Param("devId")String devId);
|
||||
}
|
||||
@@ -30,4 +30,16 @@
|
||||
t0.status="1" and
|
||||
t0.dev_id = #{devId} and t1.`type` = #{type}
|
||||
</select>
|
||||
<select id="getVersionByDevId" resultType="string">
|
||||
select
|
||||
t1.version_no
|
||||
from
|
||||
cs_dev_model_relation t0
|
||||
left join cs_dev_model t1 on
|
||||
t0.model_id = t1.id
|
||||
where
|
||||
t0.status="1" and
|
||||
t0.dev_id = #{devId}
|
||||
order by t1.version_date desc limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -53,4 +53,7 @@ public interface CsDevModelRelationService extends IService<CsDevModelRelationPO
|
||||
*/
|
||||
String getModelByType(String devId, Integer type);
|
||||
|
||||
String getVersionByDevId(String devId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -96,4 +96,9 @@ public class CsDevModelRelationServiceImpl extends ServiceImpl<CsDevModelRelatio
|
||||
public String getModelByType(String devId, Integer type) {
|
||||
return this.baseMapper.getModelByType(devId,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersionByDevId(String devId) {
|
||||
return this.baseMapper.getVersionByDevId(devId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user