代码提交

This commit is contained in:
huangzj
2023-10-26 10:03:06 +08:00
parent e069b440b8
commit 27783fe396
6 changed files with 29 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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>

View File

@@ -53,4 +53,7 @@ public interface CsDevModelRelationService extends IService<CsDevModelRelationPO
*/
String getModelByType(String devId, Integer type);
String getVersionByDevId(String devId);
}

View File

@@ -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);
}
}