Commit 0d1ee557 authored by 李腾威's avatar 李腾威

机构人员接口逻辑迁移

parent 57d0017b
package com.yeejoin.amos.boot.module.jcs.api.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo;
......@@ -68,16 +70,37 @@ public interface IOrgUsrService {
/**
* 获取动态表单数据
* @param queryWrapper
* @param id
* @return
* @throws Exception
*/
List<FormValue> getFormValue(QueryWrapper queryWrapper) throws Exception;
List<FormValue> getFormValue(Long id) throws Exception;
/**
* 保存 机构/部门/人员基本信息
* @param
* @throws Exception
*/
void saveOrgUsr (OrgUsr oriOrgUsr,Long id) throws Exception;;
void saveOrgUsr (OrgUsr oriOrgUsr,Long id) throws Exception;
/**
* 新增机构/部门/人员基本信息和动态表单数据
* @param orgUsr
* @param alertFromValuelist
*/
void saveOrgUsrAlertFormValue (OrgUsr orgUsr,List<AlertFormValue> alertFromValuelist)throws Exception;
/**
* 更新机构/部门/人员基本信息和动态表单数据
* @param alertFromValuelist
* @throws Exception
*/
void updateAlertFormValue(OrgUsr orgUsr,Long alertCalledId,List<AlertFormValue> alertFromValuelist)throws Exception;
/**
*
* @param id
* @throws Exception
*/
Map<String, Object> selectForShowById (OrgUsr orgUsr,Long id) throws Exception;
}
......@@ -53,4 +53,8 @@ public class OrgDepartmentFormVo {
public OrgDepartmentFormVo() {
}
public OrgDepartmentFormVo(List<FormValue> dynamicFormAlert) {
this.dynamicFormAlert = dynamicFormAlert;
}
}
......@@ -55,4 +55,8 @@ public class OrgPersonFormVo extends BaseEntity{
public OrgPersonFormVo() {
}
public OrgPersonFormVo(List<FormValue> dynamicFormAlert) {
this.dynamicFormAlert = dynamicFormAlert;
}
}
......@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -41,7 +42,6 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrDownloadTemplateVO;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl;
......@@ -73,16 +73,8 @@ public class OrgDepartmentController {
public ResponseModel<Object> saveOrgUsr(HttpServletRequest request, @RequestBody OrgDepartmentVo OrgDepartmentVo) {
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
// 单位新增情况
iOrgUsrService.save(orgUsr);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgDepartmentVo.getAlertFormValue();
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
// 保存动态表单数据
iAlertFromValueService.saveBatch(alertFromValuelist);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_DEPARTMENT);
iOrgUsrService.saveOrgUsrAlertFormValue(orgUsr,OrgDepartmentVo.getAlertFormValue());
return ResponseHelper.buildResponse(null);
}
......@@ -109,34 +101,15 @@ public class OrgDepartmentController {
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
@ApiOperation(httpMethod = "PUT", value = "更新部门数据", notes = "更新部门数据")
public ResponseModel<Object> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgDepartmentVo OrgDepartmentVo, @PathVariable Long id) throws Exception {
// 修改部门信息
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = iOrgUsrService.getById(id);
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
iOrgUsrService.saveOrgUsr(oriOrgUsr,id);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgDepartmentVo.getAlertFormValue();
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
List<AlertFromValueDto> formList = iAlertFromValueService.queryByCalledId(orgUsr.getSequenceNbr());
for (AlertFormValue dis : alertFromValuelist) {
for (AlertFromValueDto src : formList) {
if (dis.getAlertFormId() == src.getAlertFormId()) {
dis.setSequenceNbr(src.getSequenceNbr());
dis.setRecDate(new Date());
dis.setRecUserId(oriOrgUsr.getRecUserId());
dis.setRecUserName(oriOrgUsr.getRecUserName());
break;
}
}
}
// 保存动态表单数据
iAlertFromValueService.updateBatchById(alertFromValuelist);
iOrgUsrService.updateAlertFormValue(oriOrgUsr,orgUsr.getSequenceNbr(),OrgDepartmentVo.getAlertFormValue());
return ResponseHelper.buildResponse(null);
}
......@@ -151,26 +124,11 @@ public class OrgDepartmentController {
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取部门详情", notes = "获取部门详情")
public ResponseModel<OrgDepartmentFormVo> selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
OrgUsr orgUsr = iOrgUsrService.getById(id);
queryWrapper.eq("alert_called_id", id);
// 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id);
List<FormValue> formValue = new ArrayList();
for (AlertFormValueVo alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
formValue.add(value);
} else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
formValue.add(value);
}
}
OrgDepartmentFormVo orgDepartmentFormVo = new OrgDepartmentFormVo();
List<FormValue> formValue = iOrgUsrService.getFormValue(id);
OrgDepartmentFormVo orgDepartmentFormVo = new OrgDepartmentFormVo(formValue);
BeanUtils.copyProperties(orgUsr, orgDepartmentFormVo);
orgDepartmentFormVo.setDynamicFormAlert(formValue);
return ResponseHelper.buildResponse(orgDepartmentFormVo);
}
......
......@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -33,11 +34,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonVo;
......@@ -74,16 +71,7 @@ public class OrgPersonController {
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
// 单位新增情况
iOrgUsrService.save(orgUsr);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgPersonVo.getAlertFormValue();
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
// 保存动态表单数据
iAlertFromValueService.saveBatch(alertFromValuelist);
iOrgUsrService.saveOrgUsrAlertFormValue(orgUsr,OrgPersonVo.getAlertFormValue());
return ResponseHelper.buildResponse(null);
}
......@@ -118,29 +106,8 @@ public class OrgPersonController {
OrgUsr oriOrgUsr = iOrgUsrService.getById(id);
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
iOrgUsrService.saveOrgUsr(oriOrgUsr,id);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgPersonVo.getAlertFormValue();
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
List<AlertFromValueDto> formList = iAlertFromValueService.queryByCalledId(orgUsr.getSequenceNbr());
for (AlertFormValue dis : alertFromValuelist) {
for (AlertFromValueDto src : formList) {
if (dis.getAlertFormId() == src.getAlertFormId()) {
dis.setSequenceNbr(src.getSequenceNbr());
dis.setRecDate(new Date());
dis.setRecUserId(oriOrgUsr.getRecUserId());
dis.setRecUserName(oriOrgUsr.getRecUserName());
dis.setAlertTypeCode(src.getAlertTypeCode());
break;
}
}
}
// 保存动态表单数据
iAlertFromValueService.updateBatchById(alertFromValuelist);
iOrgUsrService.updateAlertFormValue(oriOrgUsr,orgUsr.getSequenceNbr(),OrgPersonVo.getAlertFormValue());
return ResponseHelper.buildResponse(null);
}
......@@ -153,28 +120,13 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员详情", notes = "获取人员详情")
public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id) {
public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
OrgUsr orgUsr = iOrgUsrService.getById(id);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id);
List<FormValue> formValue = new ArrayList();
for (AlertFormValueVo alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
formValue.add(value);
} else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
formValue.add(value);
}
}
OrgPersonFormVo orgUsrFormVo = new OrgPersonFormVo();
BeanUtils.copyProperties(orgUsr, orgUsrFormVo);
orgUsrFormVo.setDynamicFormAlert(formValue);
return ResponseHelper.buildResponse(orgUsrFormVo);
List<FormValue> formValue = iOrgUsrService.getFormValue(id);
OrgPersonFormVo orgPersonFormVo = new OrgPersonFormVo(formValue);
BeanUtils.copyProperties(orgUsr, orgPersonFormVo);
return ResponseHelper.buildResponse(orgPersonFormVo);
}
......@@ -187,18 +139,9 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/show/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员详情", notes = "获取人员详情")
public ResponseModel selectForShowById(HttpServletRequest request, @PathVariable Long id) {
public ResponseModel selectForShowById(HttpServletRequest request, @PathVariable Long id) throws Exception {
OrgUsr orgUsr = iOrgUsrService.getById(id);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id);
List<FormValue> formValue = new ArrayList();
Map<String, Object> result = Bean.BeantoMap(orgUsr);
for (AlertFormValueVo alertFormValue : list) {
result.put(alertFormValue.getFieldCode(), alertFormValue.getFieldValue());
}
Map<String, Object> result = iOrgUsrService.selectForShowById(orgUsr, id);
return ResponseHelper.buildResponse(result);
}
......
......@@ -76,16 +76,8 @@ public class OrgUsrController extends BaseController {
public ResponseModel saveOrgUsr(HttpServletRequest request, @RequestBody OrgUsrVo OrgUsrVo) {
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgUsrVo, orgUsr);
// 单位新增情况
iOrgUsrService.save(orgUsr);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgUsrVo.getAlertFormValue();
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
// 保存动态表单数据
iAlertFromValueService.saveBatch(alertFromValuelist);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.saveOrgUsrAlertFormValue(orgUsr,OrgUsrVo.getAlertFormValue());
return ResponseHelper.buildResponse(null);
}
......@@ -119,26 +111,8 @@ public class OrgUsrController extends BaseController {
OrgUsr oriOrgUsr = iOrgUsrService.getById(id);
BeanUtils.copyProperties(OrgUsrVo, orgUsr);
iOrgUsrService.saveOrgUsr(oriOrgUsr,id);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgUsrVo.getAlertFormValue();
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
List<AlertFromValueDto> formList = iAlertFromValueService.queryByCalledId(orgUsr.getSequenceNbr());
for (AlertFormValue dis : alertFromValuelist) {
for (AlertFromValueDto src : formList) {
if (dis.getAlertFormId() == src.getAlertFormId()) {
dis.setSequenceNbr(src.getSequenceNbr());
dis.setRecDate(new Date());
dis.setRecUserId(oriOrgUsr.getRecUserId());
dis.setRecUserName(oriOrgUsr.getRecUserName());
break;
}
}
}
// 保存动态表单数据
iAlertFromValueService.updateBatchById(alertFromValuelist);
iOrgUsrService.updateAlertFormValue(oriOrgUsr,orgUsr.getSequenceNbr(),OrgUsrVo.getAlertFormValue());
return ResponseHelper.buildResponse(null);
}
......@@ -154,22 +128,8 @@ public class OrgUsrController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取单位详情", notes = "获取单位详情")
public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
OrgUsr orgUsr = iOrgUsrService.getById(id);
QueryWrapper queryWrapper = new QueryWrapper<OrgUsr>();
queryWrapper.eq("alert_called_id", id);
// 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id);
List<FormValue> formValue = new ArrayList();
for (AlertFormValueVo alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
formValue.add(value);
} else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
formValue.add(value);
}
}
List<FormValue> formValue = iOrgUsrService.getFormValue(id);
OrgUsrFormVo orgUsrFormVo = new OrgUsrFormVo();
orgUsrFormVo.setDynamicFormAlert(formValue);
BeanUtils.copyProperties(orgUsr, orgUsrFormVo);
......@@ -283,17 +243,11 @@ public class OrgUsrController extends BaseController {
}
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
iOrgUsrService.save(orgUsr);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgDepartmentVo.getAlertFormValue();
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
// 保存动态表单数据
iAlertFromValueService.saveBatch(alertFromValuelist);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_DEPARTMENT);
iOrgUsrService.saveOrgUsrAlertFormValue(orgUsr,OrgDepartmentVo.getAlertFormValue());
return ResponseHelper.buildResponse(null);
}
/**
* 根据id获取单位人员列表
*
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrDto;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -12,14 +13,15 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import java.lang.reflect.Method;
......@@ -44,6 +46,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
AlertFormValueServiceImpl alertFormValueServiceImpl;
@Autowired
AlertFormServiceImpl alertFormServiceImpl;
@Autowired
AlertFormValueServiceImpl iAlertFromValueService;
@Override
public String selectUpUnitByParam(String biz_org_code) {
......@@ -298,15 +302,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
@Override
public List<FormValue> getFormValue(QueryWrapper queryWrapper) throws Exception {
List<AlertFormValue> list = alertFormValueServiceImpl.list(queryWrapper);
public List<FormValue> getFormValue(Long id) throws Exception {
// 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id);
List<FormValue> formValue = new ArrayList();
for (AlertFormValue alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null){
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
for (AlertFormValueVo alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
formValue.add(value);
}else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
} else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
formValue.add(value);
}
}
......@@ -324,4 +331,51 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
updateById(orgUsr);
}
@Override
public void saveOrgUsrAlertFormValue(OrgUsr orgUsr, List<AlertFormValue> alertFromValuelist) {
// 单位新增情况
save(orgUsr);
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
// 保存动态表单数据
alertFormValueServiceImpl.saveBatch(alertFromValuelist);
}
@Override
public void updateAlertFormValue(OrgUsr orgUsr,Long alertCalledId,List<AlertFormValue> alertFromValuelist) throws Exception {
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
List<AlertFromValueDto> formList = alertFormValueServiceImpl.queryByCalledId(alertCalledId);
for (AlertFormValue dis : alertFromValuelist) {
for (AlertFromValueDto src : formList) {
if (dis.getAlertFormId() == src.getAlertFormId()) {
dis.setSequenceNbr(src.getSequenceNbr());
dis.setRecDate(new Date());
dis.setRecUserId(orgUsr.getRecUserId());
dis.setRecUserName(orgUsr.getRecUserName());
break;
}
}
}
// 保存动态表单数据
alertFormValueServiceImpl.updateBatchById(alertFromValuelist);
}
@Override
public Map<String, Object> selectForShowById(OrgUsr orgUsr,Long id) throws Exception {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id);
List<FormValue> formValue = new ArrayList();
Map<String, Object> result = Bean.BeantoMap(orgUsr);
for (AlertFormValueVo alertFormValue : list) {
result.put(alertFormValue.getFieldCode(), alertFormValue.getFieldValue());
}
return result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment