|
@@ -64,22 +64,20 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
*/
|
|
|
public Boolean saveIntroduce(IntroduceVO introduceVO) {
|
|
|
IntroduceInfo introduceInfo = new IntroduceInfo();
|
|
|
- if (!(introduceVO.getId() == null || introduceInfo.getId().equals(0))) {
|
|
|
+ Date now = DateUtil.now();
|
|
|
+ String userId = UserUtils.getCurrentPrincipleID();
|
|
|
+ if (!(introduceVO.getId() == null || introduceVO.getId().equals(0))) {
|
|
|
introduceInfo = this.getById(introduceVO.getId());
|
|
|
if (introduceInfo == null) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息不存在");
|
|
|
} else if (introduceInfo.getIsDeleted().equals(IsDeleteEnum.Y.getKey())) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息已删除");
|
|
|
- } else {
|
|
|
- introduceInfo.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
- introduceInfo.setGmtModified(DateUtil.now());
|
|
|
}
|
|
|
+ } else {
|
|
|
+ introduceInfo.setCreator(userId);
|
|
|
+ introduceInfo.setGmtCreate(now);
|
|
|
}
|
|
|
|
|
|
- Date now = DateUtil.now();
|
|
|
- String userId = UserUtils.getCurrentPrincipleID();
|
|
|
- introduceInfo.setCreator(userId);
|
|
|
- introduceInfo.setGmtCreate(now);
|
|
|
introduceInfo.setModifier(userId);
|
|
|
introduceInfo.setGmtModified(now);
|
|
|
introduceInfo.setName(introduceVO.getName());
|
|
@@ -90,15 +88,14 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
|
|
|
//明细信息不更新,每次都删除重新插入
|
|
|
//删除已有明细,逻辑删除
|
|
|
- if (!(introduceInfo.getId() == null)) {
|
|
|
- UpdateWrapper<IntroduceDetail> detailUpdateWrapper = new UpdateWrapper<>();
|
|
|
- detailUpdateWrapper.eq("introduce_id", introduceInfo.getId()).
|
|
|
- eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
- set("is_deleted", IsDeleteEnum.Y.getKey()).
|
|
|
- set("modifier", UserUtils.getCurrentPrincipleID()).
|
|
|
- set("gmt_modified", DateUtil.now());
|
|
|
- introduceDetailFacade.update(new IntroduceDetail(), detailUpdateWrapper);
|
|
|
- }
|
|
|
+ UpdateWrapper<IntroduceDetail> detailUpdateWrapper = new UpdateWrapper<>();
|
|
|
+ detailUpdateWrapper.eq("introduce_id", introduceInfo.getId()).
|
|
|
+ eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
+ set("is_deleted", IsDeleteEnum.Y.getKey()).
|
|
|
+ set("modifier", userId).
|
|
|
+ set("gmt_modified", now);
|
|
|
+ introduceDetailFacade.update(new IntroduceDetail(), detailUpdateWrapper);
|
|
|
+
|
|
|
List<IntroduceDetail> introduceDetailList = Lists.newArrayList();
|
|
|
for (IntroduceDetailVO detailVO : introduceVO.getDetailVOList()) {
|
|
|
IntroduceDetail detail = new IntroduceDetail();
|