|
@@ -10,7 +10,6 @@ import com.diagbot.service.impl.IntroduceInfoServiceImpl;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.IntroducePageVO;
|
|
|
import com.diagbot.vo.IntroduceVO;
|
|
|
-import io.swagger.models.auth.In;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -49,15 +48,16 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
introduceInfo.setRemark(introduceVO.getRemark());
|
|
|
|
|
|
//明细信息不更新,每次都删除重新插入
|
|
|
- //删除已有明细
|
|
|
+ //删除已有明细,物理删除
|
|
|
if (!(introduceInfo.getId() == null)) {
|
|
|
UpdateWrapper<IntroduceDetail> detailUpdateWrapper = new UpdateWrapper<>();
|
|
|
detailUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
- eq("introduce_id", introduceInfo.getId()).
|
|
|
- set("is_deleted", IsDeleteEnum.Y.getKey()).
|
|
|
- set("gmt_modified", new Date()).
|
|
|
- set("modifier", UserUtils.getCurrentPrincipleID());
|
|
|
- introduceDetailFacade.update(new IntroduceDetail(), detailUpdateWrapper);
|
|
|
+ eq("introduce_id", introduceInfo.getId());
|
|
|
+ introduceDetailFacade.remove(detailUpdateWrapper);
|
|
|
+ }
|
|
|
+ //新增明细,清空id
|
|
|
+ for (IntroduceDetail detail : introduceVO.getDetailList()) {
|
|
|
+ detail.setId(null);
|
|
|
}
|
|
|
//插入新的明细记录
|
|
|
introduceDetailFacade.saveOrUpdateBatch(introduceVO.getDetailList());
|