Commit f17c3432 by 杨卫

feat:添加form数值转换

1 parent 481f6a41
...@@ -10,6 +10,8 @@ import cn.com.glsx.framework.core.beans.rpc.RpcPagination; ...@@ -10,6 +10,8 @@ import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -19,6 +21,7 @@ import javax.annotation.Resource; ...@@ -19,6 +21,7 @@ import javax.annotation.Resource;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Description 数字化管理-员工日报服务 * @Description 数字化管理-员工日报服务
...@@ -168,6 +171,17 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor ...@@ -168,6 +171,17 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor
@Override @Override
public RpcResponse<Integer> save(SaveStaffRecordRequestDTO dto) { public RpcResponse<Integer> save(SaveStaffRecordRequestDTO dto) {
try { try {
Map<String, String> form = dto.getForm();
if (MapUtil.isNotEmpty(form)) {
for (String key : form.keySet()) {
String value = form.get(key);
if (ObjectUtil.isNotNull(value)) {
form.remove(key);
form.put(key, ObjectUtil.toString(value));
}
}
}
ReportSaveStrategy strategy = reportSaveFactory.getStrategy(dto.getTemplateCode()); ReportSaveStrategy strategy = reportSaveFactory.getStrategy(dto.getTemplateCode());
return RpcResponse.success(strategy.save(dto)); return RpcResponse.success(strategy.save(dto));
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!