Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -136,7 +136,7 @@ public class DataLogTools {
|
||||
|
||||
public static final String SQL_LIST = "SELECT * FROM ${TBL_NAME} WHERE entity_id = ? ORDER BY operation_time DESC, flow_id DESC";
|
||||
|
||||
public static final Set<String> excludeFields = SetUtils.of("tenantId","dataVersion","createUserId","createDate","modifyUserId","modifyDate","modifyDate","deleteMark");
|
||||
public static final Set<String> excludeFields = SetUtils.of("id","tenantId","dataVersion","createUserId","createDate","modifyUserId","modifyDate","modifyDate","deleteMark");
|
||||
|
||||
|
||||
public static DataChangeLog createLog(Class<?> klazz,OperationType type) {
|
||||
@ -645,12 +645,15 @@ public class DataLogTools {
|
||||
FieldChange change = new FieldChange();
|
||||
change.setField(item.getFieldName());
|
||||
change.setName(item.getName());
|
||||
if(old!=null) {
|
||||
Object newVal = BeanUtils.getFieldValue(item.getField(),entity);
|
||||
if(old!=null) {
|
||||
Object oldVal = BeanUtils.getFieldValue(item.getField(),old);
|
||||
boolean flag = false;
|
||||
if((newVal==null && oldVal!=null) || (newVal!=null && oldVal==null)) {
|
||||
flag = true;
|
||||
boolean isString = String.class.equals(item.getJavaType());
|
||||
if(newVal==null && oldVal!=null) {
|
||||
flag = isString?StringUtils.isNotEmpty((String)oldVal):true;
|
||||
}else if(newVal!=null && oldVal==null) {
|
||||
flag = isString?StringUtils.isNotEmpty((String)newVal):true;
|
||||
}else if(newVal!=null && oldVal!=null && !newVal.equals(oldVal)) {
|
||||
flag = true;
|
||||
}
|
||||
@ -910,7 +913,7 @@ public class DataLogTools {
|
||||
DataChangeLogVo fvo = new DataChangeLogVo();
|
||||
fvo.setId(obj.getId()+"_"+fieldChange.getField());
|
||||
fvo.setPid(obj.getId());
|
||||
fvo.setName(fvo.getName());
|
||||
fvo.setName(fieldChange.getName());
|
||||
fvo.setOldValue(fieldChange.getOldValue());
|
||||
fvo.setNewValue(fieldChange.getNewValue());
|
||||
|
||||
|
||||
@ -1,37 +1,28 @@
|
||||
package com.xjrsoft.module.mdm.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||
import com.xjrsoft.module.mdm.dto.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.mdm.dto.LngBCurrencyPageDto;
|
||||
import com.xjrsoft.module.mdm.dto.UpdateLngBCurrencyDto;
|
||||
import com.xjrsoft.module.mdm.entity.LngBCurrency;
|
||||
import com.xjrsoft.module.mdm.entity.LngBPriceTerm;
|
||||
import com.xjrsoft.module.mdm.service.ICurrencyService;
|
||||
import com.xjrsoft.module.mdm.vo.LngBCurrencyPageVo;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.datalog.entity.DataChangeLog;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.mdm.vo.LngBCurrencyVo;
|
||||
import com.xjrsoft.module.mdm.vo.LngBPriceTermPageVo;
|
||||
import com.xjrsoft.module.mdm.vo.LngBPriceTermVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -98,7 +89,14 @@ public class CurrencyController {
|
||||
@SaCheckPermission("currency:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateLngBCurrencyDto.class, ids));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/datalog")
|
||||
@ApiOperation(value="根据id查询LngBCurrency数据详细日志")
|
||||
@SaCheckPermission("currency:datalog")
|
||||
public R datalog(@RequestParam Long id){
|
||||
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngBCurrencyDto.class,id);
|
||||
return R.ok(logs);
|
||||
}
|
||||
|
||||
@PostMapping("/enable")
|
||||
|
||||
@ -10,6 +10,7 @@ import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.mdm.dto.LngBPriceTermPageDto;
|
||||
import com.xjrsoft.module.mdm.dto.UpdateLngBPriceTermDto;
|
||||
import com.xjrsoft.module.mdm.entity.LngBPriceTerm;
|
||||
@ -90,6 +91,14 @@ public class PriceTermsController {
|
||||
return R.ok(dataService.deleteByIds(UpdateLngBPriceTermDto.class, ids));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/datalog")
|
||||
@ApiOperation(value="根据id查询LngBPriceTerm数据详细日志")
|
||||
@SaCheckPermission("priceTerms:datalog")
|
||||
public R datalog(@RequestParam Long id){
|
||||
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngBPriceTermDto.class,id);
|
||||
return R.ok(logs);
|
||||
}
|
||||
|
||||
@PostMapping("/enable")
|
||||
@ApiOperation(value = "启用LngBPriceTerm")
|
||||
@SaCheckPermission("priceTerms:enable")
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
<modules>
|
||||
<module>itc-pcitc-mdm-service</module>
|
||||
<module>itc-pcitc-mdm-api</module>
|
||||
<module>itc-pcitc-mdm-start</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
||||
Reference in New Issue
Block a user