Commit 727a8b9e authored by wanglong's avatar wanglong

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents f4ce035f 56877241
......@@ -168,7 +168,10 @@ public class EquipmentController extends BaseController {
public ResponseModel<EquipmentDto> saveEquipment(@RequestBody JSONObject object) {
EquipmentDto equipmentDto = equipmentServiceImpl.saveEI(object);
Long sequenceNbr = equipmentDto.getSequenceNbr();
equipmentServiceImpl.saveAttachment(object,sequenceNbr);
if (object.containsKey("subForm")){
JSONArray subForm = object.getJSONArray("subForm");
equipmentServiceImpl.saveAttachment(subForm,sequenceNbr);
}
return ResponseHelper.buildResponse(equipmentDto);
}
/**
......
......@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -90,11 +91,12 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
/**
* 根据sourceId添加附件
* @param object
* @param subForm
* @param SequenceNbr
*
*/
public void saveAttachment(JSONObject object,Long SequenceNbr){
public void saveAttachment(JSONArray subForm,Long SequenceNbr){
AttachmentDto attachmentDto = new AttachmentDto();
JSONArray subForm = object.getJSONArray("subForm");
if (!subForm.isEmpty()){
for(Object o:subForm){
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o));
......@@ -160,10 +162,15 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
model.setVerifyStatus(object.getString("verifyStatus"));
updateById(model);
JSONArray subForm = object.getJSONArray("subForm");
attachment.setInfo(JSON.toJSONString(subForm));
if(ValidationUtil.isEmpty(attachment)){
saveAttachment(subForm,sequenceNbr);
}else {
attachment.setInfo(JSON.toJSONString(subForm));
attachmentServiceImpl.updateById(attachment);
}
// new Attachment();
// BeanUtils.copyProperties(attachmentDto,attachment);
attachmentServiceImpl.updateById(attachment);
}
......
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