|
@@ -5,6 +5,7 @@ import org.jeecg.modules.aa.admincasehistory.entity.AdminRscode;
|
|
|
import org.jeecg.modules.aa.admincasehistory.mapper.AdminRscodeMapper;
|
|
|
import org.jeecg.modules.aa.admincasehistory.mapper.AdminGodownEntryMapper;
|
|
|
import org.jeecg.modules.aa.admincasehistory.service.IAdminGodownEntryService;
|
|
|
+import org.jeecg.modules.aa.admincasehistory.service.IAdminRscodeService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -26,7 +27,10 @@ public class AdminGodownEntryServiceImpl extends ServiceImpl<AdminGodownEntryMap
|
|
|
private AdminGodownEntryMapper adminGodownEntryMapper;
|
|
|
@Autowired
|
|
|
private AdminRscodeMapper adminRscodeMapper;
|
|
|
-
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IAdminRscodeService adminRscodeService;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void saveMain(AdminGodownEntry adminGodownEntry, List<AdminRscode> adminRscodeList) {
|
|
@@ -44,18 +48,18 @@ public class AdminGodownEntryServiceImpl extends ServiceImpl<AdminGodownEntryMap
|
|
|
@Transactional
|
|
|
public void updateMain(AdminGodownEntry adminGodownEntry,List<AdminRscode> adminRscodeList) {
|
|
|
adminGodownEntryMapper.updateById(adminGodownEntry);
|
|
|
-
|
|
|
+
|
|
|
//1.先删除子表数据
|
|
|
adminRscodeMapper.deleteByMainId(adminGodownEntry.getId());
|
|
|
-
|
|
|
//2.子表数据重新插入
|
|
|
if(adminRscodeList!=null && adminRscodeList.size()>0) {
|
|
|
for(AdminRscode entity:adminRscodeList) {
|
|
|
//外键设置
|
|
|
entity.setPurchaseNoteId(adminGodownEntry.getId());
|
|
|
- adminRscodeMapper.insert(entity);
|
|
|
+ //adminRscodeMapper.insert(entity);
|
|
|
}
|
|
|
}
|
|
|
+ adminRscodeService.saveBatch(adminRscodeList);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -73,5 +77,5 @@ public class AdminGodownEntryServiceImpl extends ServiceImpl<AdminGodownEntryMap
|
|
|
adminGodownEntryMapper.deleteById(id);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|