Commit df4e62ab authored by limei's avatar limei

设备管理附件上传

parent a5103e4c
...@@ -101,31 +101,31 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E ...@@ -101,31 +101,31 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
*/ */
public void saveAttachment(JSONArray subForm,Long SequenceNbr){ public void saveAttachment(JSONArray subForm,Long SequenceNbr){
AttachmentDto attachmentDto = new AttachmentDto(); AttachmentDto attachmentDto = new AttachmentDto();
attachmentDto.setInfo(JSON.toJSONString(subForm));
attachmentDto.setSourceId(SequenceNbr);
if (!subForm.isEmpty()){ if (!subForm.isEmpty()){
for(Object o:subForm){ for(Object o:subForm){
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o)); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o));
jsonObject.getString("Symbol_key"); jsonObject.getString("Symbol_key");
JSONArray jsonArray = jsonObject.getJSONArray("info"); JSONArray jsonArray = jsonObject.getJSONArray("info");
for(Object j:jsonArray){ if(!ValidationUtil.isEmpty(jsonArray)) {
JSONObject info = JSON.parseObject(JSON.toJSONString(j)); for (Object j : jsonArray) {
String name = info.getString("name"); JSONObject info = JSON.parseObject(JSON.toJSONString(j));
attachmentDto.setSourceId(SequenceNbr); String name = info.getString("name");
attachmentDto.setName(info.getString("name")); attachmentDto.setName(info.getString("name"));
// attachmentDto.setInfo("name: "+name+","+ attachmentDto.setType(name.substring(name.lastIndexOf(".")+1));
// "type: "+name.substring(name.lastIndexOf(".")+1)+","+ break;
// "path: "+info.getString("url")+","+ }
// "certCode: "+jsonObject.getString("certCode")+","+
// "certType: "+jsonObject.getString("certType"));
attachmentDto.setInfo(JSON.toJSONString(subForm));
attachmentDto.setType(name.substring(name.lastIndexOf(".")+1));
attachmentServiceImpl.createWithModel(attachmentDto);
break; break;
} }
} }
attachmentServiceImpl.createWithModel(attachmentDto);
} }
} }
@Override @Override
public EquipmentDto saveEI(JSONObject object) { public EquipmentDto saveEI(JSONObject object) {
EquipmentDto model = new EquipmentDto(); EquipmentDto model = new EquipmentDto();
......
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