rev:入库单数据修改
This commit is contained in:
@@ -7,6 +7,7 @@ import org.nl.wms.flow_manage.flow.framework.entity.ExecutionDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/*
|
||||
@@ -29,24 +30,34 @@ public class FlowStartEvent extends PublishEvent {
|
||||
return model_key;
|
||||
}
|
||||
|
||||
public FlowStartEvent build(String form_type, String form_id, JSONObject data){
|
||||
public FlowStartEvent build(String form_type, String form_id,String source_form_type,String source_form_id, JSONObject data){
|
||||
if (dto == null){
|
||||
dto = ExecutionDto.builder().form_id(form_id).form_type(form_type).t(data).build();
|
||||
dto = ExecutionDto.builder()
|
||||
.form_id(form_id)
|
||||
.form_type(form_type)
|
||||
.source_form_type(source_form_type)
|
||||
.source_form_id(source_form_id)
|
||||
.t(data).build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public FlowStartEvent build(String form_type,List<String> ids, List<JSONObject> datas){
|
||||
public FlowStartEvent build(String form_type, List<Map> datas){
|
||||
if (dto == null){
|
||||
throw new BadRequestException("主数据参数未构建");
|
||||
}
|
||||
List<ExecutionDto> item =new ArrayList();
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
String id = ids.get(i);
|
||||
JSONObject data = datas.get(i);
|
||||
ExecutionDto build = ExecutionDto.builder().form_id(id).form_type(form_type).t(data).build();
|
||||
for (Map data : datas) {
|
||||
String form_id = (String)data.get("form_id");
|
||||
String source_form_id = (String)data.get("source_form_id");
|
||||
String source_form_type = (String)data.get("source_form_type");
|
||||
JSONObject data_json = (JSONObject)data.get("t");
|
||||
ExecutionDto build = ExecutionDto.builder()
|
||||
.form_id(form_id)
|
||||
.form_type(form_type).source_form_id(source_form_id).source_form_type(source_form_type).t(data_json).build();
|
||||
item.add(build);
|
||||
}
|
||||
dto.setItem(item);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ public class ExecutionController {
|
||||
return new ResponseEntity<>(flowOperationService.startFormFlow(startProcessInstanceVo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/confirm")
|
||||
public ResponseEntity<Object> flowConfirm(String inst_id) {
|
||||
return new ResponseEntity<>(flowOperationService.flowConfirm(inst_id,null), HttpStatus.OK);
|
||||
@GetMapping(value = "/confirm/{proc_inst_id}")
|
||||
public ResponseEntity<Object> flowConfirm(@PathVariable String proc_inst_id) {
|
||||
return new ResponseEntity<>(flowOperationService.flowConfirm(proc_inst_id,null), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/queryByParentId/{id}")
|
||||
|
||||
@@ -38,6 +38,7 @@ public abstract class FlowNodeActivityBehavior<T> {
|
||||
public final void activity(ExecutionEntity<T> entity) {
|
||||
try {
|
||||
//当前节点
|
||||
log.info("流程:{},开始流程数据:{}", entity.getActivityName(),JSONObject.toJSONString(entity.getT()));
|
||||
if (StringUtils.isNotEmpty(entity.getProc_inst_id())){
|
||||
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
||||
.eq("proc_inst_id",entity.getProc_inst_id())
|
||||
@@ -47,14 +48,15 @@ public abstract class FlowNodeActivityBehavior<T> {
|
||||
.set("form_id", entity.getForm_id())
|
||||
.set("remark", "")
|
||||
.set("status", StatusEnum.FLOW_STATUS.code("启动"))
|
||||
.set("form_data", JSONObject.toJSON(entity.getT()).toString())
|
||||
.set("form_data", entity.getT().toString())
|
||||
.set("update_time", DateUtil.now()));
|
||||
}
|
||||
this.execute(entity);
|
||||
log.info("流程:{},结束流程数据:{}", entity.getActivityName(), JSONObject.toJSONString(entity.getT()));
|
||||
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
||||
.eq("proc_inst_id",entity.getProc_inst_id())
|
||||
.set("status", StatusEnum.FLOW_STATUS.code("节点完成"))
|
||||
.set("form_data", JSONObject.toJSON(entity.getT()).toString())
|
||||
.set("form_data", entity.getT().toString())
|
||||
.set("form_type",entity.getForm_type())
|
||||
.set("update_time", DateUtil.now()));
|
||||
this.leaveActivity(entity);
|
||||
@@ -78,7 +80,7 @@ public abstract class FlowNodeActivityBehavior<T> {
|
||||
historyEntity.setActivity_name(entity.getActivityName());
|
||||
historyEntity.setForm_type(entity.getForm_type());
|
||||
historyEntity.setForm_id(entity.getForm_id());
|
||||
historyEntity.setForm_data((JSONObject) JSONObject.toJSON(entity.getT()));
|
||||
historyEntity.setForm_data((JSONObject) entity.getT());
|
||||
historyEntity.setUpdate_time(DateUtil.now());
|
||||
history.save(historyEntity);
|
||||
this.leave(entity);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -75,33 +76,38 @@ public class FormActivityBehavior extends FlowNodeActivityBehavior<JSONObject> {
|
||||
if (typeHandler==null){
|
||||
throw new BadRequestException("【flow】当前节点处理类型未定义");
|
||||
}
|
||||
JSONObject handler = typeHandler.handler(currentNode.getSkipExpression(), entity.getT(), targetStruc);
|
||||
JSONObject handler = typeHandler.handler(currentNode.getSkipExpression(), entity.getT() , targetStruc);
|
||||
|
||||
//该参数里包含三部分:主数据基础字段,组数据自定义及明细,
|
||||
//明细:基础字段,组数据自定义及参数:
|
||||
//TODO:id,code等非映射字段后续可以通过SpringEL表达式生成
|
||||
handler.put("id",IdUtil.getStringId());
|
||||
handler.put("create_time",DateUtil.now());
|
||||
handler.put("create_id",SecurityUtils.getCurrentUserId());
|
||||
handler.put("status",StatusEnum.FORM_STATUS.code("生成"));
|
||||
handler.put("code",CodeUtil.getNewCode("IO_CODE"));
|
||||
StIvtIostorinvIn mst = handler.toJavaObject(StIvtIostorinvIn.class);
|
||||
JSONObject mst_json = handler.getJSONObject("t");
|
||||
mst_json.put("id",IdUtil.getStringId());
|
||||
mst_json.put("create_time",DateUtil.now());
|
||||
mst_json.put("create_id",SecurityUtils.getCurrentUserId());
|
||||
mst_json.put("status",StatusEnum.FORM_STATUS.code("生成"));
|
||||
mst_json.put("code",CodeUtil.getNewCode("IO_CODE"));
|
||||
StIvtIostorinvIn mst = mst_json.toJavaObject(StIvtIostorinvIn.class);
|
||||
handler.put("form_id",mst.getId());
|
||||
|
||||
JSONArray itemArr = handler.getJSONArray("item");
|
||||
if(itemArr !=null){
|
||||
Object item = mst_json.remove("item");
|
||||
if(item !=null){
|
||||
JSONArray itemArr = (JSONArray) item;
|
||||
for (int i = 0; i < itemArr.size(); i++) {
|
||||
JSONObject dtl = itemArr.getJSONObject(i);
|
||||
dtl.put("inv_id",mst.getId());
|
||||
dtl.put("status",StatusEnum.FORM_STATUS.code("生成"));
|
||||
dtl.put("id",IdUtil.getStringId());
|
||||
StIvtIostorinvdtlIn iostorinvdtl= dtl.toJavaObject(StIvtIostorinvdtlIn.class);
|
||||
JSONObject dtl_json = dtl.getJSONObject("t");
|
||||
dtl_json.put("inv_id",mst.getId());
|
||||
dtl_json.put("status",StatusEnum.FORM_STATUS.code("生成"));
|
||||
dtl_json.put("id",IdUtil.getStringId());
|
||||
StIvtIostorinvdtlIn iostorinvdtl= dtl_json.toJavaObject(StIvtIostorinvdtlIn.class);
|
||||
iostorinvdtlService.save(iostorinvdtl);
|
||||
dtl.put("form_id",iostorinvdtl.getId());
|
||||
}
|
||||
}
|
||||
iostorinvService.save(mst);
|
||||
entity.setT(handler);
|
||||
entity.setForm_id(mst.getId());
|
||||
entity.setForm_type(currentNode.getForm_type());
|
||||
entity.setForm_id(entity.getForm_id());
|
||||
entity.setForm_type(entity.getForm_type());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,18 +21,19 @@ import org.springframework.util.CollectionUtils;
|
||||
public class ServerTaskActivityBehavior extends FlowNodeActivityBehavior<JSONObject> {
|
||||
@Override
|
||||
public void execute(ExecutionEntity<JSONObject> entity) {
|
||||
System.out.println(entity.getForm_id());
|
||||
String form_id = entity.getForm_id();
|
||||
String form_type = entity.getForm_type();
|
||||
FlowElement element = entity.getCurrentFlowElement();
|
||||
ServerTask currentNode = (ServerTask) element;
|
||||
if (!CollectionUtils.isEmpty(currentNode.getSkipExpression())) {
|
||||
TypeHandler<ExecutionDto, ExecutionEntity<JSONObject>> typeHandler = TypeHandler.HANDLER_MAP.get(currentNode.getCategory());
|
||||
TypeHandler<JSONObject,JSONObject> typeHandler = TypeHandler.HANDLER_MAP.get(currentNode.getCategory());
|
||||
if (typeHandler == null) {
|
||||
throw new BadRequestException("【flow】当前节点处理类型未定义");
|
||||
}
|
||||
ExecutionDto result = typeHandler.handler(currentNode.getSkipExpression(), entity, null);
|
||||
entity.setT(result.getT());
|
||||
entity.setForm_id(result.getForm_id());
|
||||
entity.setForm_type(currentNode.getForm_type());
|
||||
JSONObject handler = typeHandler.handler(currentNode.getSkipExpression(), entity.getT(), null);
|
||||
entity.setT(handler);
|
||||
entity.setForm_id(form_id);
|
||||
entity.setForm_type(form_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class ExecutionDto {
|
||||
/**
|
||||
* 表单id
|
||||
@@ -27,6 +28,14 @@ public class ExecutionDto {
|
||||
* 单据类型
|
||||
*/
|
||||
private String form_type;
|
||||
/**
|
||||
* 源单id
|
||||
*/
|
||||
private String source_form_id;
|
||||
/**
|
||||
* 源单类型
|
||||
*/
|
||||
private String source_form_type;
|
||||
/**
|
||||
* 主数据
|
||||
*/
|
||||
@@ -36,36 +45,4 @@ public class ExecutionDto {
|
||||
*/
|
||||
private List<ExecutionDto> item;
|
||||
|
||||
/**
|
||||
* 获取数据时:合并主表明细表
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getT() {
|
||||
t.put("item",item);
|
||||
return t;
|
||||
}
|
||||
|
||||
public void setT(JSONObject t) {
|
||||
this.t = t;
|
||||
}
|
||||
|
||||
public void setItem(List<ExecutionDto> item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getForm_id() {
|
||||
return form_id;
|
||||
}
|
||||
|
||||
public void setForm_id(String form_id) {
|
||||
this.form_id = form_id;
|
||||
}
|
||||
|
||||
public String getForm_type() {
|
||||
return form_type;
|
||||
}
|
||||
|
||||
public void setForm_type(String form_type) {
|
||||
this.form_type = form_type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,29 +15,45 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
@Getter
|
||||
public class ExecutionEntity<T> implements Cloneable{
|
||||
@Override
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
}catch (Exception ex){
|
||||
throw new BadRequestException(ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前流程节点
|
||||
*/
|
||||
protected FlowElement currentFlowElement;
|
||||
//用于获取当前流程实例对象
|
||||
/**
|
||||
* 对应流程实例id
|
||||
*/
|
||||
protected String proc_inst_id;
|
||||
//父流程实例id
|
||||
/**
|
||||
* 父流程id
|
||||
*/
|
||||
protected String parent_id;
|
||||
//当前流程id=currentFlowElement.getId()
|
||||
/**
|
||||
* 开始流程id
|
||||
*/
|
||||
protected String startActivityId;
|
||||
/**
|
||||
* 当前流程id
|
||||
*/
|
||||
protected String activityId;
|
||||
/**
|
||||
* 流程节点名称
|
||||
*/
|
||||
protected String activityName;
|
||||
/**
|
||||
* 流程部署id
|
||||
*/
|
||||
protected String deploymentId;
|
||||
/**
|
||||
* 源单类型
|
||||
*/
|
||||
protected String form_type;
|
||||
protected BmFormStruc form_struc;
|
||||
/**
|
||||
* 源单id
|
||||
*/
|
||||
protected String form_id;
|
||||
protected BmFormStruc form_struc;
|
||||
|
||||
//回调执行
|
||||
protected Consumer callback = null;
|
||||
|
||||
@@ -84,4 +100,15 @@ public class ExecutionEntity<T> implements Cloneable{
|
||||
public void setCallback(Consumer callback) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
}catch (Exception ex){
|
||||
throw new BadRequestException(ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,9 +31,12 @@ public class MappingHandler extends TypeHandler<JSONObject, JSONObject> {
|
||||
@Override
|
||||
public JSONObject handler(List<String> param, JSONObject data, BmFormStruc form_struc) {
|
||||
//数据平铺
|
||||
JSONObject forms = data.getJSONObject("form_data");
|
||||
JSONObject sourceFormData = new JSONObject(data.getJSONObject("t"));
|
||||
String souceFromId = data.getString("form_id");
|
||||
String souceFromType = data.getString("form_type");
|
||||
JSONObject forms = sourceFormData.getJSONObject("form_data");
|
||||
if (forms!=null){
|
||||
data.putAll(forms);
|
||||
sourceFormData.putAll(forms);
|
||||
}
|
||||
//数据字段列表
|
||||
List<String> fields = ListOf.of(form_struc.getBiz_code()
|
||||
@@ -45,13 +48,13 @@ public class MappingHandler extends TypeHandler<JSONObject, JSONObject> {
|
||||
, form_struc.getVehicle_code()
|
||||
, form_struc.getQty());
|
||||
//查询目标表字段
|
||||
JSONObject returnObj = new JSONObject();
|
||||
JSONObject t = new JSONObject();
|
||||
//基础字段映射:如果只有一个就不迭代
|
||||
JSONObject mapping = JSONObject.parseObject(param.size()==1?param.get(0):param.remove(0));
|
||||
for (String field : fields) {
|
||||
if (field!=null){
|
||||
String value = data.getString(mapping.getString(field));
|
||||
returnObj.put(field,value);
|
||||
String value = sourceFormData.getString(mapping.getString(field));
|
||||
t.put(field,value);
|
||||
}
|
||||
}
|
||||
//查询表单配置表,获取自定义json:自定义字段参数获取
|
||||
@@ -61,14 +64,14 @@ public class MappingHandler extends TypeHandler<JSONObject, JSONObject> {
|
||||
for (String item : form_param.keySet()) {
|
||||
String mappingConfig = mapping.getString(item);
|
||||
if (StringUtils.isNotEmpty(mappingConfig)){
|
||||
String value = data.getString(mappingConfig);
|
||||
String value = sourceFormData.getString(mappingConfig);
|
||||
form_data.put(item,value);
|
||||
}
|
||||
}
|
||||
returnObj.put("form_data",form_data);
|
||||
t.put("form_data",form_data);
|
||||
}
|
||||
JSONArray item = data.getJSONArray("item");
|
||||
BmFormStruc item_struc = iBmFormStrucService.getOne(new QueryWrapper<BmFormStruc>().eq("parent_id",form_struc.getForm_type()));
|
||||
BmFormStruc item_struc = iBmFormStrucService.getOne(new QueryWrapper<BmFormStruc>().eq("parent_id",form_struc.getId()));
|
||||
if (item!=null){
|
||||
//暂定:强制校验
|
||||
if (item_struc == null){
|
||||
@@ -78,8 +81,14 @@ public class MappingHandler extends TypeHandler<JSONObject, JSONObject> {
|
||||
for (int i = 0; i < item.size(); i++) {
|
||||
itemList.add(this.handler(param, item.getJSONObject(i), item_struc));
|
||||
}
|
||||
returnObj.put("item",itemList);
|
||||
t.put("item",itemList);
|
||||
}
|
||||
return returnObj;
|
||||
JSONObject resultT = new JSONObject();
|
||||
resultT.put("form_type",form_struc.getForm_type());
|
||||
resultT.put("form_id","");
|
||||
resultT.put("source_form_type",souceFromType);
|
||||
resultT.put("source_form_id",souceFromId);
|
||||
resultT.put("t",t);
|
||||
return resultT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ public class ExecutionQuery extends BaseQuery<ActRuExecution> {
|
||||
|
||||
private String search;
|
||||
|
||||
private String proc_inst_id;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("name", QParam.builder().k(new String[]{"name"}).type(QueryTEnum.LK).build());
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
@@ -37,9 +38,9 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
|
||||
@Override
|
||||
public Object getAll(ExecutionQuery query, PageQuery page) {
|
||||
//判断是否存在子实例
|
||||
LambdaQueryWrapper<ActRuExecution> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.isNull(ActRuExecution::getParent_id);
|
||||
Page<ActRuExecution> executionPage = this.page(page.build(), lqw);
|
||||
QueryWrapper<ActRuExecution> build = (QueryWrapper)query.build();
|
||||
build.isNull("parent_id");
|
||||
Page<ActRuExecution> executionPage = this.page(page.build(), build);
|
||||
List<ActRuExecution> records = executionPage.getRecords();
|
||||
this.findChildren(records);
|
||||
return TableDataInfo.build(executionPage);
|
||||
|
||||
@@ -58,10 +58,10 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
||||
//创建流程参数ExecutionEntity:执行流程
|
||||
ExecutionEntity entity = new ExecutionEntity();
|
||||
entity.setCurrentFlowElement(bpmnModel.getStartEvent());
|
||||
entity.setT(dto.getT());
|
||||
entity.setT(JSONObject.toJSON(dto));
|
||||
entity.setCallback(callback);
|
||||
entity.setForm_type(dto.getForm_type());
|
||||
entity.setForm_id(dto.getForm_id());
|
||||
entity.setForm_type(dto.getSource_form_type());
|
||||
entity.setForm_id(dto.getSource_form_id());
|
||||
entity.setStartActivityId(entity.getActivityId());
|
||||
entity.setDeploymentId(deployment.getDeployment_id());
|
||||
commandExecutor.execute(new StartInstanceCmd(),entity);
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.publish.BussEventMulticaster;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
@@ -84,7 +85,7 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
|
||||
|
||||
List<MdGruopDtl> items = new ArrayList<>();
|
||||
List<MdPbVehicleMater> vehicleMaters = new ArrayList<>();
|
||||
List<JSONObject> dtlJson = new ArrayList<>();
|
||||
List<Map> dtlJson = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(forms)){
|
||||
for (int i = 0; i < tableData.size(); i++) {
|
||||
Map item = tableData.get(i);
|
||||
@@ -97,7 +98,10 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
|
||||
MdPbVehicleMater vehicleMater = item_json.toJavaObject(MdPbVehicleMater.class);
|
||||
items.add(mdGruopDtl);
|
||||
vehicleMaters.add(vehicleMater);
|
||||
dtlJson.add(item_json);
|
||||
dtlJson.add(MapOf.of("form_id",mdGruopDtl.getId()
|
||||
,"t",item_json
|
||||
,"source_form_type",mdGruopDtl.getSource_form_type()
|
||||
,"source_form_id",mdGruopDtl.getSource_form_id()));
|
||||
}
|
||||
}
|
||||
this.save(mdGroupMst);
|
||||
@@ -107,8 +111,8 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
|
||||
BussEventMulticaster.Publish(new FlowStartEvent("md_group_dick", (Consumer<String>) proc_inst_id -> {
|
||||
self.update(new UpdateWrapper<MdGruopDick>()
|
||||
.set("proc_inst_id",proc_inst_id).eq("id",mdGroupMst.getId())); })
|
||||
.build("md_group_dick",mdGroupMst.getId(),forms)
|
||||
.build("md_group_dtl",items.stream().map(MdGruopDtl::getId).collect(Collectors.toList()), dtlJson)
|
||||
.build("md_group_dick",mdGroupMst.getId(),mdGroupMst.getSource_form_type(),mdGroupMst.getSource_form_id(),forms)
|
||||
.build("md_group_dtl",dtlJson)
|
||||
,true);
|
||||
}
|
||||
|
||||
|
||||
@@ -191,15 +191,17 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
for (String field : fields) {
|
||||
if (StringUtils.isNotEmpty(field)) {
|
||||
JSONObject itemMappingConfig = fieldMapping.get(field);
|
||||
if (itemMappingConfig == null) {
|
||||
throw new BadRequestException(String.format(" 当前表单没有配置字段:%s 映射", new String[]{field}));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(itemMappingConfig.getString("skipExpression"))) {
|
||||
//el表达式解析
|
||||
SpelMap.put(field, itemMappingConfig.getString("skipExpression"));
|
||||
} else {
|
||||
data.put(field, sourceData.getString(itemMappingConfig.getString("mapping_field")));
|
||||
if (itemMappingConfig != null) {
|
||||
if (StringUtils.isNotEmpty(itemMappingConfig.getString("skipExpression"))) {
|
||||
//el表达式解析
|
||||
SpelMap.put(field, itemMappingConfig.getString("skipExpression"));
|
||||
} else {
|
||||
data.put(field, sourceData.getString(itemMappingConfig.getString("mapping_field")));
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// throw new BadRequestException(String.format(" 当前表单没有配置字段:%s 映射", new String[]{field}));
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(SpelMap)) {
|
||||
|
||||
Reference in New Issue
Block a user