This commit is contained in:
张秉卓
2026-01-22 17:24:51 +08:00
parent 989dd66a20
commit ca095be435
5 changed files with 171 additions and 16 deletions

View File

@ -5,6 +5,7 @@ import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.module.approve.ApproveDto;
import com.xjrsoft.module.datalog.vo.CompareResultVo;
import com.xjrsoft.module.dayPlan.dto.LngPngApproPageDto;
import com.xjrsoft.module.dayPlan.dto.UpdateLngPngApproDto;
import com.xjrsoft.module.dayPlan.entity.LngPngAppro;
@ -12,7 +13,6 @@ import com.xjrsoft.module.dayPlan.vo.LngPngApproPageVo;
import com.xjrsoft.module.dayPlan.vo.LngPngApproVo;
import javax.validation.Valid;
import java.util.List;
/**
* @title: service
@ -33,5 +33,5 @@ public interface IPngApproService extends MPJBaseService<LngPngAppro>, MPJDeepSe
void approveJSZ(@Valid ApproveDto<UpdateLngPngApproDto> dto);
List<LngPngApproVo> compare(Long orgId);
CompareResultVo<LngPngApproVo> compare(Long orgId);
}

View File

@ -12,11 +12,13 @@ import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.pictc.jdbc.JdbcTools;
import com.pictc.jdbc.model.JdbcParam;
import com.pictc.utils.ObjectDiffUtils;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.module.approve.ApproveDto;
import com.xjrsoft.module.datalog.vo.CompareResultVo;
import com.xjrsoft.module.dayPlan.dto.LngPngApproPageDto;
import com.xjrsoft.module.dayPlan.dto.UpdateLngPngApproDto;
import com.xjrsoft.module.dayPlan.dto.UpdateLngPngApproPurDto;
@ -36,6 +38,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -81,7 +84,7 @@ public class PngApproServiceImpl extends MPJBaseServiceImpl<LngPngApproMapper, L
}
@Override
public List<LngPngApproVo> compare(Long orgId) {
public CompareResultVo<LngPngApproVo> compare(Long orgId) {
List<LngPngApproVo> voList = this.baseMapper.getListByOrgId(orgId);
if(CollectionUtils.isEmpty(voList)) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
@ -90,7 +93,16 @@ public class PngApproServiceImpl extends MPJBaseServiceImpl<LngPngApproMapper, L
List<LngPngApproPurVo> lngPngApproPurList = this.baseMapper.queryLngPngApproPurList(vo.getId());
vo.setLngPngApproPurList(lngPngApproPurList);
}
return voList;
CompareResultVo<LngPngApproVo> vo = new CompareResultVo<>();
LngPngApproVo newBean = voList.get(0);
vo.setNewBean(newBean);
if (voList.size() > 1) {
LngPngApproVo oldBean = voList.get(1);
List<String> diffResultList = ObjectDiffUtils.compare(newBean, oldBean);
vo.setOldBean(oldBean);
vo.setDiffResultList(diffResultList);
}
return vo;
}
@Override
@ -170,15 +182,15 @@ public class PngApproServiceImpl extends MPJBaseServiceImpl<LngPngApproMapper, L
SaSession tokenSession = StpUtil.getTokenSession();
UserDto user = tokenSession.get(GlobalConstant.LOGIN_USER_INFO_KEY, new UserDto());
for (UpdateLngPngApproDto lngPngApproDto : data) {
LngPngAppro lngPngAppro = this.baseMapper.selectById(lngPngApproDto.getId());
if(lngPngAppro == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
LocalDateTime datePlan = lngPngApproDto.getDatePlan();
if(datePlan == null) {
throw new BusinessException(BusinessCode.of(10500,"没有计划日期"));
}
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofString(user.getStaCode()));
params.add(JdbcParam.ofLocalDateTime(lngPngAppro.getDatePlan()));
params.add(JdbcParam.ofLocalDateTime(datePlan));
params.add(JdbcParam.ofString(dto.getResult()));
params.add(JdbcParam.ofString(dto.getRemark()));
params.add(JdbcParam.ofLong(user.getId()));
@ -202,15 +214,15 @@ public class PngApproServiceImpl extends MPJBaseServiceImpl<LngPngApproMapper, L
SaSession tokenSession = StpUtil.getTokenSession();
UserDto user = tokenSession.get(GlobalConstant.LOGIN_USER_INFO_KEY, new UserDto());
for (UpdateLngPngApproDto lngPngApproDto : data) {
LngPngAppro lngPngAppro = this.baseMapper.selectById(lngPngApproDto.getId());
if(lngPngAppro == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
LocalDateTime datePlan = lngPngApproDto.getDatePlan();
if(datePlan == null) {
throw new BusinessException(BusinessCode.of(10500,"没有计划日期"));
}
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofString(user.getStaCode()));
params.add(JdbcParam.ofLocalDateTime(lngPngAppro.getDatePlan()));
params.add(JdbcParam.ofLocalDateTime(datePlan));
params.add(JdbcParam.ofString(dto.getResult()));
params.add(JdbcParam.ofString(dto.getRemark()));
params.add(JdbcParam.ofLong(user.getId()));

View File

@ -1,9 +1,6 @@
package com.xjrsoft.module.sales.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.github.yulichang.annotation.EntityMapping;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -52,11 +49,13 @@ public class LngCustomerGroup implements Serializable {
* 起始日期
*/
@ApiModelProperty("起始日期")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime dateFrom;
/**
* 结束日期
*/
@ApiModelProperty("结束日期")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime dateTo;
/**
* 备注