Browse Source

升级2.0.0

master
陈裕财 2 years ago
parent
commit
c7c09aa0df
  1. 32
      mdp-form/src/main/java/com/mdp/form/service/FormDataProcessApprovaService.java
  2. 228
      mdp-form/src/main/java/com/mdp/form/service/FormDataService.java
  3. 69
      mdp-form/src/main/java/com/mdp/form/service/FormDataTagService.java
  4. 98
      mdp-form/src/main/java/com/mdp/form/service/FormDefService.java
  5. 74
      mdp-form/src/main/java/com/mdp/form/service/FormDefTagService.java
  6. 48
      mdp-form/src/main/java/com/mdp/form/service/FormFieldService.java
  7. 32
      mdp-form/src/main/java/com/mdp/form/service/FormQxService.java
  8. 32
      mdp-form/src/main/java/com/mdp/form/service/FormViewService.java

32
mdp-form/src/main/java/com/mdp/form/service/FormDataProcessApprovaService.java

@ -1,17 +1,37 @@
package com.mdp.form.service; package com.mdp.form.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.form.entity.FormDataProcessApprova;
import com.mdp.form.mapper.FormDataProcessApprovaMapper;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDataProcessApprova FORM.form_data_process_approva 当前主键(包括多主键): id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDataProcessApprova form_data_process_approva 当前主键(包括多主键): id;
***/ ***/
@Service("mdp.form.formDataProcessApprovaService")
public class FormDataProcessApprovaService extends BaseService {
/** 请在此类添加自定义函数 */
@Service
public class FormDataProcessApprovaService extends BaseService<FormDataProcessApprovaMapper,FormDataProcessApprova> {
static Logger logger =LoggerFactory.getLogger(FormDataProcessApprovaService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
} }

228
mdp-form/src/main/java/com/mdp/form/service/FormDataService.java

@ -1,57 +1,71 @@
package com.mdp.form.service; package com.mdp.form.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mdp.core.utils.BaseUtils;
import com.mdp.form.FormUtil;
import com.mdp.form.entity.*; import com.mdp.form.entity.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips; import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException; import com.mdp.core.err.BizException;
import com.mdp.core.service.BaseService;
import com.mdp.core.utils.BaseUtils;
import com.mdp.form.FormUtil;
import com.mdp.form.mapper.FormDataMapper;
import org.springframework.util.StringUtils;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormData FORM.form_data 当前主键(包括多主键): id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormData form_data 当前主键(包括多主键): id;
***/ ***/
@Service("mdp.form.formDataService")
public class FormDataService extends BaseService {
@Service
public class FormDataService extends BaseService<FormDataMapper,FormData> {
static Logger logger =LoggerFactory.getLogger(FormDataService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
/** 请在此类添加自定义函数 */ /** 请在此类添加自定义函数 */
@Autowired @Autowired
FormDataTagService tagService;
FormDataTagService tagService;
@Autowired @Autowired
FormFieldService formFieldService; FormFieldService formFieldService;
@Autowired @Autowired
FormDataProcessApprovaService formDataProcessApprovaService; FormDataProcessApprovaService formDataProcessApprovaService;
/** /**
* 更新tagIds,tagNames两个字段为最新的值 * 更新tagIds,tagNames两个字段为最新的值
* @param dataId
* @param dataId
* @param tagIds * @param tagIds
* @param tagNames * @param tagNames
*/ */
public void updateTagsByDataId(String dataId, String tagIds, String tagNames) { public void updateTagsByDataId(String dataId, String tagIds, String tagNames) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Map<String,Object> p=new HashMap<>(); Map<String,Object> p=new HashMap<>();
p.put("id", dataId);
p.put("id", dataId);
p.put("tagIds", tagIds); p.put("tagIds", tagIds);
p.put("tagNames", tagNames);
p.put("tagNames", tagNames);
this.update("updateTagsById", p); this.update("updateTagsById", p);
} }
/** /**
* 流程结束时调用更新数据状态未2 审核结束 * 流程结束时调用更新数据状态未2 审核结束
* @param flowState * @param flowState
@ -70,7 +84,7 @@ public class FormDataService extends BaseService {
* @param formData * @param formData
* @return * @return
*/ */
public int insertOrUpdate(FormDataVo formData,boolean checkFlowState) {
public int insertOrUpdate(FormDataVo formData, boolean checkFlowState) {
String formId=formData.getFormId(); String formId=formData.getFormId();
FormDefVo formDefVo=formFieldService.getFormFieldFromCache(formId); FormDefVo formDefVo=formFieldService.getFormFieldFromCache(formId);
Tips tips=this.createFormDataBizKey(formDefVo.getFormFields(), formId, formData); Tips tips=this.createFormDataBizKey(formDefVo.getFormFields(), formId, formData);
@ -80,34 +94,34 @@ public class FormDataService extends BaseService {
if(StringUtils.isEmpty(formData.getId())){ if(StringUtils.isEmpty(formData.getId())){
formData.setId(this.createKey("id")); formData.setId(this.createKey("id"));
formData.setCreateTime(new Date()); formData.setCreateTime(new Date());
formData.setLastTime(new Date());
formData.setLastTime(new Date());
FormData fd=this.getDbFormDataByBizKey(formData.getBizKey()); FormData fd=this.getDbFormDataByBizKey(formData.getBizKey());
if(fd!=null) { if(fd!=null) {
throw new BizException("exists-form-data-biz-key","bizKey","数据已经存在不能再添加"); throw new BizException("exists-form-data-biz-key","bizKey","数据已经存在不能再添加");
}else { }else {
return this.insert(formData); return this.insert(formData);
}
}else{
}
}else{
formData.setLastTime(new Date()); formData.setLastTime(new Date());
FormData fd=this.getDbFormDataByBizKey(formData.getBizKey()); FormData fd=this.getDbFormDataByBizKey(formData.getBizKey());
if(fd==null) {//如果通过bizKey查不出来 if(fd==null) {//如果通过bizKey查不出来
FormData fdObject=this.selectOneObject(formData); FormData fdObject=this.selectOneObject(formData);
if(fdObject!=null) {//通过id可以查出来通过bizKey查不出来说明是修改了bizKey,可以更新 if(fdObject!=null) {//通过id可以查出来通过bizKey查不出来说明是修改了bizKey,可以更新
if(checkFlowState) {
if(checkFlowState) {
if("0".equals(fdObject.getFlowState())) { if("0".equals(fdObject.getFlowState())) {
formData.setLastTime(new Date()); formData.setLastTime(new Date());
return super.updateByPk(formData); return super.updateByPk(formData);
}else {
}else {
if("1".equals(fdObject.getFlowState())) { if("1".equals(fdObject.getFlowState())) {
throw new BizException("flow-state-error-001","审核中的数据不允许修改"); throw new BizException("flow-state-error-001","审核中的数据不允许修改");
}else if("2".equals(fdObject.getFlowState())) { }else if("2".equals(fdObject.getFlowState())) {
throw new BizException("flow-state-error-002","审核完毕的数据不允许修改"); throw new BizException("flow-state-error-002","审核完毕的数据不允许修改");
}else { }else {
throw new BizException("flow-state-error-003","数据状态不正确"); throw new BizException("flow-state-error-003","数据状态不正确");
}
}
}
}
}else { }else {
formData.setLastTime(new Date()); formData.setLastTime(new Date());
return super.updateByPk(formData); return super.updateByPk(formData);
@ -117,15 +131,15 @@ public class FormDataService extends BaseService {
formData.setLastTime(new Date()); formData.setLastTime(new Date());
if(StringUtils.isEmpty(formData.getFlowState())) { if(StringUtils.isEmpty(formData.getFlowState())) {
formData.setFlowState("0"); formData.setFlowState("0");
}
}
return this.insert(formData); return this.insert(formData);
} }
}else {//如果通过bizKey查得出来 }else {//如果通过bizKey查得出来
//如果id相同说明是同一条数据 //如果id相同说明是同一条数据
if(fd.getId().equals(formData.getId())) { if(fd.getId().equals(formData.getId())) {
if(checkFlowState) {
if(checkFlowState) {
if("0".equals(fd.getFlowState())) { if("0".equals(fd.getFlowState())) {
formData.setLastTime(new Date()); formData.setLastTime(new Date());
return super.updateByPk(formData); return super.updateByPk(formData);
@ -145,7 +159,7 @@ public class FormDataService extends BaseService {
}else {//如果id不相同说明不是同一条数据 }else {//如果id不相同说明不是同一条数据
throw new BizException("form-data-biz-key-exists","数据已经存在,不能继续添加,请检查是否关键数据错误"); throw new BizException("form-data-biz-key-exists","数据已经存在,不能继续添加,请检查是否关键数据错误");
} }
} }
} }
} }
@ -166,27 +180,27 @@ public class FormDataService extends BaseService {
Tips tips=new Tips("表单检验成功"); Tips tips=new Tips("表单检验成功");
List<FormDataVo> needInsertList=new ArrayList<>(); List<FormDataVo> needInsertList=new ArrayList<>();
List<FormDataVo> needUpdateList=new ArrayList<>(); List<FormDataVo> needUpdateList=new ArrayList<>();
for (FormDataVo formData : formDatas) { for (FormDataVo formData : formDatas) {
tips=this.createFormDataBizKey(formFields, formId, formData); tips=this.createFormDataBizKey(formFields, formId, formData);
if(tips.isOk()==false) { if(tips.isOk()==false) {
throw new BizException(tips);
}
throw new BizException(tips);
}
FormData fd=this.getDbFormDataByBizKey(formData.getBizKey()); FormData fd=this.getDbFormDataByBizKey(formData.getBizKey());
if(fd==null) {//如果通过bizKey查不出来 if(fd==null) {//如果通过bizKey查不出来
FormData fdObject=this.selectOneObject(formData); FormData fdObject=this.selectOneObject(formData);
if(fdObject!=null) {//通过id可以查出来通过bizKey查不出来说明是修改了bizKey,可以更新 if(fdObject!=null) {//通过id可以查出来通过bizKey查不出来说明是修改了bizKey,可以更新
formData.setLastTime(new Date());
formData.setLastTime(new Date());
needUpdateList.add(formData); needUpdateList.add(formData);
}else {//通过id也查不出来通过bizKey查不出来说明是新增 }else {//通过id也查不出来通过bizKey查不出来说明是新增
formData.setCreateTime(new Date()); formData.setCreateTime(new Date());
formData.setLastTime(new Date()); formData.setLastTime(new Date());
formData.setFlowState("1");
formData.setFlowState("1");
needInsertList.add(formData); needInsertList.add(formData);
} }
}else {//如果通过bizKey查得出来 }else {//如果通过bizKey查得出来
//如果id相同说明是同一条数据 //如果id相同说明是同一条数据
if(fd.getId().equals(formData.getId())) { if(fd.getId().equals(formData.getId())) {
formData.setLastTime(new Date()); formData.setLastTime(new Date());
@ -194,9 +208,9 @@ public class FormDataService extends BaseService {
}else {//如果id不相同说明不是同一条数据 }else {//如果id不相同说明不是同一条数据
throw new BizException("form-data-biz-key-exists","数据已经存在,不能继续添加,请检查是否关键数据错误"); throw new BizException("form-data-biz-key-exists","数据已经存在,不能继续添加,请检查是否关键数据错误");
} }
} }
} }
if(needInsertList.size()>0) { if(needInsertList.size()>0) {
this.batchInsert(needInsertList); this.batchInsert(needInsertList);
@ -208,10 +222,10 @@ public class FormDataService extends BaseService {
}else { }else {
this.update("batchUpdateWithoutFlowState", formDatas); this.update("batchUpdateWithoutFlowState", formDatas);
} }
} }
} }
/** /**
@ -221,73 +235,73 @@ public class FormDataService extends BaseService {
* PROCESS_COMPLETED 流程正常结束 全局 * PROCESS_COMPLETED 流程正常结束 全局
* PROCESS_CANCELLED 流程删除 全局 * PROCESS_CANCELLED 流程删除 全局
* create 人工任务启动 * create 人工任务启动
* complete 人工任务完成
* complete 人工任务完成
* assignment 人工任务分配给了具体的人 * assignment 人工任务分配给了具体的人
* delete 人工任务被删除 * delete 人工任务被删除
* TASK_COMPLETED_FORM_DATA_UPDATE 人工任务提交完成后智能表单数据更新 * TASK_COMPLETED_FORM_DATA_UPDATE 人工任务提交完成后智能表单数据更新
*
*
* 其中 create/complete/assignment/delete事件是需要在模型中人工节点上配置了委托代理表达式 ${taskBizCallListener}才会推送过来 * 其中 create/complete/assignment/delete事件是需要在模型中人工节点上配置了委托代理表达式 ${taskBizCallListener}才会推送过来
* 在人工任务节点上配置 任务监听器 建议事件为 complete,其它assignment/create/complete/delete也可以一般建议在complete,委托代理表达式 ${taskBizCallListener} * 在人工任务节点上配置 任务监听器 建议事件为 complete,其它assignment/create/complete/delete也可以一般建议在complete,委托代理表达式 ${taskBizCallListener}
*
* @param flowVars {flowBranchId,agree,procInstId,startUserid,assignee,actId,taskName,mainTitle,branchId,bizKey,commentMsg,eventName,modelKey}
*
* @param flowVars {flowBranchId,agree,procInstId,startUserid,assignee,actId,taskName,mainTitle,branchId,bizKey,commentMsg,eventName,modelKey}
* @return 如果tips.isOk==false将影响流程提交 * @return 如果tips.isOk==false将影响流程提交
**/ **/
public void processApprova(Map<String, Object> flowVars) { public void processApprova(Map<String, Object> flowVars) {
String procInstId=(String) flowVars.get("procInstId"); String procInstId=(String) flowVars.get("procInstId");
String eventName=(String) flowVars.get("eventName"); String eventName=(String) flowVars.get("eventName");
String formId=(String) flowVars.get("formId"); String formId=(String) flowVars.get("formId");
String agree=(String) flowVars.get("agree");
if(FormUtil.TASK_COMPLETED_FORM_DATA_UPDATE.equals(eventName) || FormUtil.TASK_COMPLETED.equals(eventName)) {
Map<String,Object> formDatasMap=( Map<String,Object>) flowVars.get("formData");
if(formDatasMap!=null) {
String agree=(String) flowVars.get("agree");
if(FormUtil.TASK_COMPLETED_FORM_DATA_UPDATE.equals(eventName) || FormUtil.TASK_COMPLETED.equals(eventName)) {
Map<String,Object> formDatasMap=( Map<String,Object>) flowVars.get("formData");
if(formDatasMap!=null) {
List<String> fieldIds=(List<String>) flowVars.get(FormUtil.NEED_UPDATE_FORM_DATA_FIELD_ID_LIST); List<String> fieldIds=(List<String>) flowVars.get(FormUtil.NEED_UPDATE_FORM_DATA_FIELD_ID_LIST);
Map<String,Object> needUpdateFormDataMap=new HashMap<>(); Map<String,Object> needUpdateFormDataMap=new HashMap<>();
if(fieldIds !=null && fieldIds.size() > 0) {
if(fieldIds !=null && fieldIds.size() > 0) {
for (String fieldId : fieldIds) { for (String fieldId : fieldIds) {
Object value=formDatasMap.get(fieldId); Object value=formDatasMap.get(fieldId);
needUpdateFormDataMap.put(fieldId, value); needUpdateFormDataMap.put(fieldId, value);
}
FormDataVo formDataVo=BaseUtils.fromMap(needUpdateFormDataMap, FormDataVo.class);
FormDefVo formDefVo=this.formFieldService.getFormFieldFromCache(formId);
Tips tips=this.createFormDataBizKey(formDefVo.getFormFields(), formId, formDataVo);
needUpdateFormDataMap.put("procInstId", procInstId);
if(tips.isOk()) {
needUpdateFormDataMap.put("bizKey", formDataVo.getBizKey());
this.updateSomeFieldsByProcInstId(needUpdateFormDataMap);
}else {
//formData.setBizKey(formDataVo.getBizKey());
this.updateSomeFieldsByProcInstId(needUpdateFormDataMap);
}
}
FormDataVo formDataVo=BaseUtils.fromMap(needUpdateFormDataMap, FormDataVo.class);
FormDefVo formDefVo=this.formFieldService.getFormFieldFromCache(formId);
Tips tips=this.createFormDataBizKey(formDefVo.getFormFields(), formId, formDataVo);
needUpdateFormDataMap.put("procInstId", procInstId);
if(tips.isOk()) {
needUpdateFormDataMap.put("bizKey", formDataVo.getBizKey());
this.updateSomeFieldsByProcInstId(needUpdateFormDataMap);
}else {
//formData.setBizKey(formDataVo.getBizKey());
this.updateSomeFieldsByProcInstId(needUpdateFormDataMap);
}
} }
} }
}else { }else {
if("PROCESS_STARTED".equals(eventName)) {
if("PROCESS_STARTED".equals(eventName)) {
Map<String,Object> formDatasMap=( Map<String,Object>) flowVars.get("formData"); Map<String,Object> formDatasMap=( Map<String,Object>) flowVars.get("formData");
List<FormDataVo> formDatas=new ArrayList<>(); List<FormDataVo> formDatas=new ArrayList<>();
List<FormDataProcessApprova> approvas=new ArrayList<>();
if(formDatasMap!=null && formDatasMap.size()>0) {
FormDataVo formDataVo=BaseUtils.fromMap(formDatasMap, FormDataVo.class);
if(StringUtils.isEmpty(formDataVo.getId())) {
formDataVo.setId(this.createKey("id"));
}
formDataVo.setFlowState("1");
formDatas.add(formDataVo);
FormDataProcessApprova approva=BaseUtils.fromMap(flowVars, FormDataProcessApprova.class);
approva.setBranchId(approva.getBranchId());
approva.setFormDataId(formDataVo.getId());
approva.setFormId(formDataVo.getFormId());
approva.setFlowLastTime(new Date());
approva.setFlowState("1");
approva.setId(this.createKey("id"));
approvas.add(approva);
this.batchInsertOrUpdate(formDatas, true);
List<FormDataProcessApprova> approvas=new ArrayList<>();
if(formDatasMap!=null && formDatasMap.size()>0) {
FormDataVo formDataVo=BaseUtils.fromMap(formDatasMap, FormDataVo.class);
if(StringUtils.isEmpty(formDataVo.getId())) {
formDataVo.setId(this.createKey("id"));
}
formDataVo.setFlowState("1");
formDatas.add(formDataVo);
FormDataProcessApprova approva=BaseUtils.fromMap(flowVars, FormDataProcessApprova.class);
approva.setBranchId(approva.getBranchId());
approva.setFormDataId(formDataVo.getId());
approva.setFormId(formDataVo.getFormId());
approva.setFlowLastTime(new Date());
approva.setFlowState("1");
approva.setId(this.createKey("id"));
approvas.add(approva);
this.batchInsertOrUpdate(formDatas, true);
this.formDataProcessApprovaService.batchInsert(approvas); this.formDataProcessApprovaService.batchInsert(approvas);
} }
}else if("PROCESS_COMPLETED".equals(eventName)) { }else if("PROCESS_COMPLETED".equals(eventName)) {
@ -296,15 +310,15 @@ public class FormDataService extends BaseService {
}else { }else {
this.updateFlowStateByProcInst("3", formId, procInstId); this.updateFlowStateByProcInst("3", formId, procInstId);
} }
}else if("PROCESS_CANCELLED".equals(eventName)) { }else if("PROCESS_CANCELLED".equals(eventName)) {
this.updateFlowStateByProcInst("4", formId, procInstId); this.updateFlowStateByProcInst("4", formId, procInstId);
} }
}
}
} }
private int updateSomeFieldsByProcInstId(Map<String, Object> needUpdateFormDataMap) { private int updateSomeFieldsByProcInstId(Map<String, Object> needUpdateFormDataMap) {
return this.update("updateSomeFieldsByProcInstId", needUpdateFormDataMap); return this.update("updateSomeFieldsByProcInstId", needUpdateFormDataMap);
} }
@ -337,9 +351,9 @@ public class FormDataService extends BaseService {
hasPrefix=true; hasPrefix=true;
bizKey=formData.getDeptid(); bizKey=formData.getDeptid();
} }
} }
Map<String,Object> formDataMap=BaseUtils.toMap(formData);
Map<String,Object> formDataMap= BaseUtils.toMap(formData);
for (FormField formField : formFields) { for (FormField formField : formFields) {
String fkey=formField.getIsBizKey(); String fkey=formField.getIsBizKey();
String fieldIdCamel=formField.getFieldIdCamel(); String fieldIdCamel=formField.getFieldIdCamel();
@ -358,10 +372,10 @@ public class FormDataService extends BaseService {
} }
formData.setBizKey(bizKey); formData.setBizKey(bizKey);
return tips; return tips;
} }
public FormData getDbFormDataByBizKey(String bizKey){ public FormData getDbFormDataByBizKey(String bizKey){
return this.selectOne("getDbFormDataByBizKey", bizKey); return this.selectOne("getDbFormDataByBizKey", bizKey);
} }

69
mdp-form/src/main/java/com/mdp/form/service/FormDataTagService.java

@ -1,23 +1,44 @@
package com.mdp.form.service; package com.mdp.form.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import com.mdp.core.entity.Tips;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.form.entity.FormDataTag; import com.mdp.form.entity.FormDataTag;
import com.mdp.form.mapper.FormDataTagMapper;
import org.springframework.util.StringUtils;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDataTag FORM.form_data_tag 当前主键(包括多主键): data_id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDataTag form_data_tag 当前主键(包括多主键): id;
***/ ***/
@Service("mdp.form.formDataTagService")
public class FormDataTagService extends BaseService {
@Service
public class FormDataTagService extends BaseService<FormDataTagMapper,FormDataTag> {
static Logger logger =LoggerFactory.getLogger(FormDataTagService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
/** 请在此类添加自定义函数 */ /** 请在此类添加自定义函数 */
public void batchInsertTags(String tagIds,String tagNames,String dataId,String formId){ public void batchInsertTags(String tagIds,String tagNames,String dataId,String formId){
if(!StringUtils.isEmpty(tagIds) && !StringUtils.isEmpty(tagNames) ) { if(!StringUtils.isEmpty(tagIds) && !StringUtils.isEmpty(tagNames) ) {
@ -26,12 +47,12 @@ public class FormDataTagService extends BaseService {
if(tagIdsArr.length==tagIdsNamesArr.length) { if(tagIdsArr.length==tagIdsNamesArr.length) {
List<FormDataTag> tags=new ArrayList<>(); List<FormDataTag> tags=new ArrayList<>();
int index=0; int index=0;
for (String tagId : tagIdsArr) {
for (String tagId : tagIdsArr) {
FormDataTag formDataTag =new FormDataTag(); FormDataTag formDataTag =new FormDataTag();
formDataTag.setDataId(dataId); formDataTag.setDataId(dataId);
formDataTag.setTagId(tagId); formDataTag.setTagId(tagId);
formDataTag.setTagName(tagIdsNamesArr[index]); formDataTag.setTagName(tagIdsNamesArr[index]);
formDataTag.setId(this.createKey("id"));
formDataTag.setId(this.createKey("id"));
index=index+1; index=index+1;
} }
this.batchInsert(tags); this.batchInsert(tags);
@ -40,30 +61,30 @@ public class FormDataTagService extends BaseService {
} }
public Tips batchInsertOrDeleteTags( String dataId,List<FormDataTag> tags) { public Tips batchInsertOrDeleteTags( String dataId,List<FormDataTag> tags) {
Tips tips =new Tips("成功更新标签");
Tips tips =new Tips("成功更新标签");
List<String> tagIds=new ArrayList<>(); List<String> tagIds=new ArrayList<>();
for (FormDataTag tag : tags) { for (FormDataTag tag : tags) {
tagIds.add(tag.getTagId()); tagIds.add(tag.getTagId());
}
}
FormDataTag tagQuery=new FormDataTag(); FormDataTag tagQuery=new FormDataTag();
tagQuery.setDataId(dataId); tagQuery.setDataId(dataId);
List<FormDataTag> dbTags=this.selectListByWhere(tagQuery); List<FormDataTag> dbTags=this.selectListByWhere(tagQuery);
List<FormDataTag> needDeleteList=new ArrayList<>(); List<FormDataTag> needDeleteList=new ArrayList<>();
List<FormDataTag> needAddList=new ArrayList<>(); List<FormDataTag> needAddList=new ArrayList<>();
Date date=new Date();
Date date=new Date();
boolean existsDbTags=dbTags!=null && dbTags.size()>0; boolean existsDbTags=dbTags!=null && dbTags.size()>0;
if(tags==null || tags.size()<=0) {//清空标签 if(tags==null || tags.size()<=0) {//清空标签
//清除流程实例标签表 //清除流程实例标签表
if(existsDbTags) { if(existsDbTags) {
this.batchDelete(dbTags); this.batchDelete(dbTags);
}
}
//TODO 清除流程实例参数表的tagIdstagNames字段 //TODO 清除流程实例参数表的tagIdstagNames字段
tips.setMsg("删除标签成功"); tips.setMsg("删除标签成功");
return tips; return tips;
} }
for (FormDataTag tag : tags) { for (FormDataTag tag : tags) {
boolean exists=false;
if(existsDbTags) {
boolean exists=false;
if(existsDbTags) {
for (FormDataTag dbTag : dbTags) { for (FormDataTag dbTag : dbTags) {
if(dbTag.getTagId().equals(tag.getTagId())) { if(dbTag.getTagId().equals(tag.getTagId())) {
exists=true; exists=true;
@ -72,15 +93,15 @@ public class FormDataTagService extends BaseService {
} }
} }
} }
if(exists==false) {
tag.setDataId(dataId);
if(exists==false) {
tag.setDataId(dataId);
tag.setId(this.createKey("id")); tag.setId(this.createKey("id"));
tag.setCreateTime(date);
tag.setCreateTime(date);
needAddList.add(tag); needAddList.add(tag);
} }
}
}
if(needAddList.size()>0) { if(needAddList.size()>0) {
this.batchInsert(needAddList); this.batchInsert(needAddList);
} }
@ -88,7 +109,7 @@ public class FormDataTagService extends BaseService {
this.batchDelete(needDeleteList); this.batchDelete(needDeleteList);
} }
return tips; return tips;
} }
} }

98
mdp-form/src/main/java/com/mdp/form/service/FormDefService.java

@ -1,5 +1,14 @@
package com.mdp.form.service; package com.mdp.form.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mdp.form.entity.FormDefVo;
import com.mdp.form.entity.FormField;
import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -7,52 +16,65 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.form.entity.FormDef;
import com.mdp.form.mapper.FormDefMapper;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import com.mdp.core.err.BizException;
import com.mdp.core.service.BaseService;
import com.mdp.form.entity.FormDef;
import com.mdp.form.entity.FormDefVo;
import com.mdp.form.entity.FormField;
import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDef FORM.form_def 当前主键(包括多主键): id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDef form_def 当前主键(包括多主键): id;
***/ ***/
@Service("mdp.form.formDefService")
public class FormDefService extends BaseService {
@Service
public class FormDefService extends BaseService<FormDefMapper,FormDef> {
static Logger logger =LoggerFactory.getLogger(FormDefService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
/** 请在此类添加自定义函数 */ /** 请在此类添加自定义函数 */
@Autowired @Autowired
FormFieldService ffs;
FormFieldService ffs;
@Autowired @Autowired
FormFieldCacheService formFieldCacheService; FormFieldCacheService formFieldCacheService;
/** /**
* 更新tagIds,tagNames两个字段为最新的值 * 更新tagIds,tagNames两个字段为最新的值
* @param formId
* @param formId
* @param tagIds * @param tagIds
* @param tagNames * @param tagNames
*/ */
public void updateTagsByFormId(String formId, String tagIds, String tagNames) { public void updateTagsByFormId(String formId, String tagIds, String tagNames) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Map<String,Object> p=new HashMap<>(); Map<String,Object> p=new HashMap<>();
p.put("id", formId);
p.put("id", formId);
p.put("tagIds", tagIds); p.put("tagIds", tagIds);
p.put("tagNames", tagNames);
p.put("tagNames", tagNames);
this.update("updateTagsById", p); this.update("updateTagsById", p);
} }
@Transactional @Transactional
public void addFormDefAndFields(FormDefVo formDefVo) { public void addFormDefAndFields(FormDefVo formDefVo) {
User user=LoginUtils.getCurrentUserInfo();
// TODO Auto-generated method stub
User user= LoginUtils.getCurrentUserInfo();
// TODO Auto-generated method stub
FormDef formDef=formDefVo.getFormDef(); FormDef formDef=formDefVo.getFormDef();
String formId= this.createKey("id"); String formId= this.createKey("id");
formDef.setId(formId); formDef.setId(formId);
@ -62,11 +84,11 @@ public class FormDefService extends BaseService {
formDef.setBranchId(user.getBranchId()); formDef.setBranchId(user.getBranchId());
formDef.setDeptid(user.getDeptid()); formDef.setDeptid(user.getDeptid());
formDef.setDeptName(user.getDeptName()); formDef.setDeptName(user.getDeptName());
List<FormField> formFields=formDefVo.getFormFields(); List<FormField> formFields=formDefVo.getFormFields();
for (FormField formField : formFields) {
String fieldBizKey=formField.getIsBizKey();
for (FormField formField : formFields) {
String fieldBizKey=formField.getIsBizKey();
if(StringUtils.isEmpty(fieldBizKey) ) { if(StringUtils.isEmpty(fieldBizKey) ) {
throw new BizException("is-biz-key-err-001", "isBizKey", "表单字段定义的主键编码错误,长度应为3位 格式位 111 第一位代表创建人是否为主键,第二位代表创建部门是否为主键,第三位代表该字段是否为主键"); throw new BizException("is-biz-key-err-001", "isBizKey", "表单字段定义的主键编码错误,长度应为3位 格式位 111 第一位代表创建人是否为主键,第二位代表创建部门是否为主键,第三位代表该字段是否为主键");
}else if( fieldBizKey.length()!=3) { }else if( fieldBizKey.length()!=3) {
@ -79,23 +101,23 @@ public class FormDefService extends BaseService {
this.ffs.batchInsert("insert",formFields); this.ffs.batchInsert("insert",formFields);
formFieldCacheService.putFormFields(formId, formDefVo); formFieldCacheService.putFormFields(formId, formDefVo);
} }
@Transactional @Transactional
public void editFormDefAndFields(FormDefVo formDefVo) { public void editFormDefAndFields(FormDefVo formDefVo) {
User user=LoginUtils.getCurrentUserInfo();
User user=LoginUtils.getCurrentUserInfo();
List<FormField> formFields=formDefVo.getFormFields(); List<FormField> formFields=formDefVo.getFormFields();
if(formFields==null || formFields.size()==0) { if(formFields==null || formFields.size()==0) {
throw new BizException("请配置表单字段后提交"); throw new BizException("请配置表单字段后提交");
} }
FormDef formDef=formDefVo.getFormDef();
FormDef formDef=formDefVo.getFormDef();
formDef.setCtime(new Date()); formDef.setCtime(new Date());
formDef.setUserid(user.getUserid()); formDef.setUserid(user.getUserid());
formDef.setUsername(user.getUsername()); formDef.setUsername(user.getUsername());
formDef.setBranchId(user.getBranchId()); formDef.setBranchId(user.getBranchId());
formDef.setDeptid(user.getDeptid()); formDef.setDeptid(user.getDeptid());
formDef.setDeptName(user.getDeptName());
for (FormField formField : formFields) {
String fieldBizKey=formField.getIsBizKey();
formDef.setDeptName(user.getDeptName());
for (FormField formField : formFields) {
String fieldBizKey=formField.getIsBizKey();
if(StringUtils.isEmpty(fieldBizKey) ) { if(StringUtils.isEmpty(fieldBizKey) ) {
throw new BizException("is-biz-key-err-001", "isBizKey", "表单字段定义的主键编码错误,长度应为3位 格式位 111 第一位代表创建人是否为主键,第二位代表创建部门是否为主键,第三位代表该字段是否为主键"); throw new BizException("is-biz-key-err-001", "isBizKey", "表单字段定义的主键编码错误,长度应为3位 格式位 111 第一位代表创建人是否为主键,第二位代表创建部门是否为主键,第三位代表该字段是否为主键");
}else if( fieldBizKey.length()!=3) { }else if( fieldBizKey.length()!=3) {
@ -103,16 +125,16 @@ public class FormDefService extends BaseService {
} }
formField.setFormId(formDef.getId()); formField.setFormId(formDef.getId());
formField.setId(ffs.createKey("id")); formField.setId(ffs.createKey("id"));
}
this.updateByPk(formDef);
}
this.updateByPk(formDef);
this.ffs.deleteByFormId(formDef.getId()); this.ffs.deleteByFormId(formDef.getId());
this.ffs.batchDelete( formFields);
this.ffs.batchInsert(formFields);
this.ffs.batchDelete( formFields);
this.ffs.batchInsert(formFields);
formFieldCacheService.putFormFields(formDef.getId(), formDefVo); formFieldCacheService.putFormFields(formDef.getId(), formDefVo);
} }
String getString(Object obj){ String getString(Object obj){
if(obj==null){ if(obj==null){
return null; return null;

74
mdp-form/src/main/java/com/mdp/form/service/FormDefTagService.java

@ -1,29 +1,47 @@
package com.mdp.form.service; package com.mdp.form.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.*;
import com.mdp.core.entity.Tips;
import org.springframework.stereotype.Service;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.form.entity.FormDefTag; import com.mdp.form.entity.FormDefTag;
import com.mdp.form.mapper.FormDefTagMapper;
import org.springframework.util.StringUtils;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDefTag FORM.form_def_tag 当前主键(包括多主键): form_id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormDefTag form_def_tag 当前主键(包括多主键): id;
***/ ***/
@Service("mdp.form.formDefTagService")
public class FormDefTagService extends BaseService {
@Service
public class FormDefTagService extends BaseService<FormDefTagMapper,FormDefTag> {
static Logger logger =LoggerFactory.getLogger(FormDefTagService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
/** 请在此类添加自定义函数 */ /** 请在此类添加自定义函数 */
/** 请在此类添加自定义函数
/** 请在此类添加自定义函数
* @return */ * @return */
public void batchInsertTags(String tagIds,String tagNames,String branchId,String userid,String formId){ public void batchInsertTags(String tagIds,String tagNames,String branchId,String userid,String formId){
if(!StringUtils.isEmpty(tagIds) && !StringUtils.isEmpty(tagNames) ) { if(!StringUtils.isEmpty(tagIds) && !StringUtils.isEmpty(tagNames) ) {
String[] tagIdsArr=tagIds.split(","); String[] tagIdsArr=tagIds.split(",");
@ -36,7 +54,7 @@ public class FormDefTagService extends BaseService {
formDefTag.setFormId(formId); formDefTag.setFormId(formId);
formDefTag.setTagId(tagId); formDefTag.setTagId(tagId);
formDefTag.setTagName(tagIdsNamesArr[index]); formDefTag.setTagName(tagIdsNamesArr[index]);
formDefTag.setId(this.createKey("id"));
formDefTag.setId(this.createKey("id"));
index=index+1; index=index+1;
} }
this.batchInsert(tags); this.batchInsert(tags);
@ -46,7 +64,7 @@ public class FormDefTagService extends BaseService {
public Tips batchInsertOrDeleteTags(String formId,List<FormDefTag> tags) { public Tips batchInsertOrDeleteTags(String formId,List<FormDefTag> tags) {
Tips tips =new Tips("成功更新标签"); Tips tips =new Tips("成功更新标签");
Map<String,Object> m=new HashMap<>();
Map<String,Object> m=new HashMap<>();
m.put("formId", formId); m.put("formId", formId);
List<String> tagIds=new ArrayList<>(); List<String> tagIds=new ArrayList<>();
for (FormDefTag tag : tags) { for (FormDefTag tag : tags) {
@ -58,20 +76,20 @@ public class FormDefTagService extends BaseService {
List<FormDefTag> dbTags=this.selectListByWhere(tagQuery); List<FormDefTag> dbTags=this.selectListByWhere(tagQuery);
List<FormDefTag> needDeleteList=new ArrayList<>(); List<FormDefTag> needDeleteList=new ArrayList<>();
List<FormDefTag> needAddList=new ArrayList<>(); List<FormDefTag> needAddList=new ArrayList<>();
Date date=new Date();
Date date=new Date();
boolean existsDbTags=dbTags!=null && dbTags.size()>0; boolean existsDbTags=dbTags!=null && dbTags.size()>0;
if(tags==null || tags.size()<=0) {//清空标签 if(tags==null || tags.size()<=0) {//清空标签
//清除流程实例标签表 //清除流程实例标签表
if(existsDbTags) { if(existsDbTags) {
this.batchDelete(dbTags); this.batchDelete(dbTags);
}
}
//TODO 清除流程实例参数表的tagIdstagNames字段 //TODO 清除流程实例参数表的tagIdstagNames字段
tips.setMsg("删除标签成功"); tips.setMsg("删除标签成功");
return tips; return tips;
} }
for (FormDefTag tag : tags) { for (FormDefTag tag : tags) {
boolean exists=false;
if(existsDbTags) {
boolean exists=false;
if(existsDbTags) {
for (FormDefTag dbTag : dbTags) { for (FormDefTag dbTag : dbTags) {
if(dbTag.getTagId().equals(tag.getTagId())) { if(dbTag.getTagId().equals(tag.getTagId())) {
exists=true; exists=true;
@ -80,15 +98,15 @@ public class FormDefTagService extends BaseService {
} }
} }
} }
if(exists==false) {
tag.setFormId(formId);
if(exists==false) {
tag.setFormId(formId);
tag.setId(this.createKey("id")); tag.setId(this.createKey("id"));
tag.setCreateTime(date);
tag.setCreateTime(date);
needAddList.add(tag); needAddList.add(tag);
} }
}
}
if(needAddList.size()>0) { if(needAddList.size()>0) {
this.batchInsert(needAddList); this.batchInsert(needAddList);
} }
@ -96,7 +114,7 @@ public class FormDefTagService extends BaseService {
this.batchDelete(needDeleteList); this.batchDelete(needDeleteList);
} }
return tips; return tips;
} }
} }

48
mdp-form/src/main/java/com/mdp/form/service/FormFieldService.java

@ -1,36 +1,57 @@
package com.mdp.form.service; package com.mdp.form.service;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mdp.form.entity.FormDef; import com.mdp.form.entity.FormDef;
import com.mdp.form.entity.FormDefVo; import com.mdp.form.entity.FormDefVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.form.entity.FormField; import com.mdp.form.entity.FormField;
import com.mdp.form.mapper.FormFieldMapper;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormField FORM.form_field 当前主键(包括多主键): id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormField form_field 当前主键(包括多主键): id;
***/ ***/
@Service("mdp.form.formFieldService")
public class FormFieldService extends BaseService {
@Service
public class FormFieldService extends BaseService<FormFieldMapper,FormField> {
static Logger logger =LoggerFactory.getLogger(FormFieldService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
@Autowired @Autowired
FormFieldCacheService formFieldCacheService; FormFieldCacheService formFieldCacheService;
@Autowired @Autowired
FormDefService formDefService; FormDefService formDefService;
public void deleteByFormId(String formId) { public void deleteByFormId(String formId) {
this.delete("deleteByFormId", formId); this.delete("deleteByFormId", formId);
} }
public FormDefVo getFormFieldFromCache(String formId){ public FormDefVo getFormFieldFromCache(String formId){
FormDefVo formDefVo=this.formFieldCacheService.getFromFields(formId); FormDefVo formDefVo=this.formFieldCacheService.getFromFields(formId);
if(formDefVo==null) { if(formDefVo==null) {
@ -46,6 +67,5 @@ public class FormFieldService extends BaseService {
return formDefVo; return formDefVo;
} }
/** 请在此类添加自定义函数 */ /** 请在此类添加自定义函数 */
} }

32
mdp-form/src/main/java/com/mdp/form/service/FormQxService.java

@ -1,17 +1,37 @@
package com.mdp.form.service; package com.mdp.form.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.form.entity.FormQx;
import com.mdp.form.mapper.FormQxMapper;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormQx FORM.form_qx 当前主键(包括多主键): form_id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormQx form_qx 当前主键(包括多主键): form_id;
***/ ***/
@Service("mdp.form.formQxService")
public class FormQxService extends BaseService {
/** 请在此类添加自定义函数 */
@Service
public class FormQxService extends BaseService<FormQxMapper,FormQx> {
static Logger logger =LoggerFactory.getLogger(FormQxService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
} }

32
mdp-form/src/main/java/com/mdp/form/service/FormViewService.java

@ -1,17 +1,37 @@
package com.mdp.form.service; package com.mdp.form.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.form.entity.FormView;
import com.mdp.form.mapper.FormViewMapper;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com.qqkj 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormView FORM.form_view 当前主键(包括多主键): id;
* 组织 com 顶级模块 mdp 大模块 form 小模块 <br>
* 实体 FormView form_view 当前主键(包括多主键): id;
***/ ***/
@Service("mdp.form.formViewService")
public class FormViewService extends BaseService {
/** 请在此类添加自定义函数 */
@Service
public class FormViewService extends BaseService<FormViewMapper,FormView> {
static Logger logger =LoggerFactory.getLogger(FormViewService.class);
/**
* 自定义查询支持多表关联
* @param page 分页条件
* @param ew 一定要并且必须加@Param("ew")注解
* @param ext 如果xml中需要根据某些值进行特殊处理可以通过这个进行传递非必须注解也可以不加
* @return
*/
public List<Map<String,Object>> selectListMapByWhere(IPage page, QueryWrapper ew, Map<String,Object> ext){
return baseMapper.selectListMapByWhere(page,ew,ext);
}
} }
Loading…
Cancel
Save