|
|
|
@ -32,6 +32,8 @@ import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import java.lang.reflect.Field; |
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -56,6 +58,8 @@ public class CommodityCodeModifyLogServiceImpl implements CommodityCodeModifyLog |
|
|
|
|
@Resource |
|
|
|
|
private UserCenterConfig userCenterConfig; |
|
|
|
|
|
|
|
|
|
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 比较两个集团物料编码的区别并且保存历史记录 |
|
|
|
|
* |
|
|
|
@ -102,9 +106,7 @@ public class CommodityCodeModifyLogServiceImpl implements CommodityCodeModifyLog |
|
|
|
|
@Override |
|
|
|
|
@SneakyThrows |
|
|
|
|
public QueryModifyLogResultDTO queryPage(QueryModifyLogDTO dto) { |
|
|
|
|
int pageSize = dto.getPageSize(); |
|
|
|
|
int currPage = dto.getCurrPage(); |
|
|
|
|
PageHelper.startPage(currPage, pageSize); |
|
|
|
|
|
|
|
|
|
CommodityCodeModifyLog query = new CommodityCodeModifyLog(); |
|
|
|
|
query.setCommodityCodeId(dto.getCommodityId()); |
|
|
|
|
List<CommodityCodeModifyLog> commodityCodeModifyLogs = commodityCodeModifyLogDao.queryAll(query); |
|
|
|
@ -148,14 +150,21 @@ public class CommodityCodeModifyLogServiceImpl implements CommodityCodeModifyLog |
|
|
|
|
|
|
|
|
|
// 处理keyName
|
|
|
|
|
i.setKeyName(CommodityModifiyLogKeyNameEnum.getKeyNameByKey(i.getKey())); |
|
|
|
|
if(i.getNewValue() == null){i.setNewValue("");} |
|
|
|
|
try { |
|
|
|
|
i.setModifyTime(sdf.parse(sdf.format(i.getModifyTime()))); |
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Date modifyDate = commodityCodeModifyLogs.size() > 0 ? commodityCodeModifyLogs.get(commodityCodeModifyLogs.size() - 1).getModifyTime() : null; |
|
|
|
|
String modifyUserName = commodityCodeModifyLogs.size() > 0 ? commodityCodeModifyLogs.get(commodityCodeModifyLogs.size() - 1).getModifyUserName() : null; |
|
|
|
|
PageInfo<CommodityCodeModifyLog> pageInfo = new PageInfo<>(commodityCodeModifyLogs); |
|
|
|
|
// PageInfo<CommodityCodeModifyLog> pageInfo = new PageInfo<>(commodityCodeModifyLogs);
|
|
|
|
|
QueryModifyLogResultDTO resultDTO = new QueryModifyLogResultDTO(); |
|
|
|
|
resultDTO.setPageUtils(new PageUtils(pageInfo.getList(), (int) pageInfo.getTotal(), pageInfo.getPageSize(), pageInfo.getPageNum())); |
|
|
|
|
//resultDTO.setPageUtils(pageInfo.getList());
|
|
|
|
|
resultDTO.setList(commodityCodeModifyLogs); |
|
|
|
|
resultDTO.setModifyDate(modifyDate); |
|
|
|
|
resultDTO.setModifyUserName(modifyUserName); |
|
|
|
|
return resultDTO; |
|
|
|
|