Commit b8666f6c authored by gaodongdong's avatar gaodongdong

添加人员编辑接口

parent ebeb6689
......@@ -19,7 +19,7 @@ public class AlertFromValueDto extends BaseDto {
@ApiModelProperty(value = "表单id")
private Integer alertFromId;
private Long alertFormId;
@ApiModelProperty(value = "警情id")
private Long alertCalledId;
......@@ -42,4 +42,7 @@ public class AlertFromValueDto extends BaseDto {
@ApiModelProperty(value = "操作人名称")
private String recUserName;
private Boolean isBlock;
private Boolean isDelete;
}
......@@ -49,7 +49,7 @@ public class AlertFormValue extends BaseEntity {
private String recUserName;
@ApiModelProperty(value = "是否一行显示")
private boolean isBlock;
private Boolean isBlock;
public AlertFormValue() {
super();
......
package com.yeejoin.amos.boot.module.jcs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -18,7 +20,7 @@ import java.util.List;
@Accessors(chain = true)
@TableName("cb_org_usr")
@ApiModel(value="OrgUsrVo", description="人员信息")
public class OrgPersonFormVo {
public class OrgPersonFormVo extends BaseEntity{
private static final long serialVersionUID = 1L;
......
......@@ -138,7 +138,7 @@ public class AlertCalledController extends BaseController {
List<FormValue> formValue = new ArrayList<FormValue>();
if(list!=null&&list.size()>0) {
for (AlertFormValue alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(),alertFormValue.isBlock());
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(),alertFormValue.getIsBlock());
formValue.add(value);
}
}
......
......@@ -143,10 +143,10 @@ public class OrgDepartmentController {
List<FormValue> formValue = new ArrayList<FormValue>();
for (AlertFormValue alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null){
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(), alertFormValue.isBlock());
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
formValue.add(value);
}else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValueCode(), alertFormValue.isBlock());
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
formValue.add(value);
}
}
......
......@@ -32,6 +32,7 @@ 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.FormValue;
......@@ -45,8 +46,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
/**
* @author fengwang
* @date 2021-06-21.
......@@ -69,8 +68,9 @@ public class OrgPersonController {
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增人员信息", notes = "新增人员信息")
public ResponseModel saveOrgUsr(HttpServletRequest request, @RequestBody OrgPersonVo OrgPersonVo) {
OrgUsr orgUsr = new OrgUsr() ;
BeanUtils.copyProperties(OrgPersonVo,orgUsr);
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
// 单位新增情况
iOrgUsrService.save(orgUsr);
// 动态表单
......@@ -95,11 +95,11 @@ public class OrgPersonController {
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public ResponseModel deleteById(HttpServletRequest request, @PathVariable Long id) {
// 删除时,只作逻辑删除
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
iOrgUsrService.update(
new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
return ResponseHelper.buildResponse(null);
}
/**
* 更新人员数据
*
......@@ -108,10 +108,17 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonVo OrgPersonVo, @PathVariable Long id) {
public ResponseModel updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonVo OrgPersonVo,
@PathVariable Long id) {
// 修改人员信息
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgPersonVo,orgUsr);
OrgUsr oriOrgUsr = iOrgUsrService.getById(id);
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
orgUsr.setSequenceNbr(id);
orgUsr.setRecDate(new Date());
orgUsr.setRecUserId(oriOrgUsr.getRecUserId());
orgUsr.setRecUserName(oriOrgUsr.getRecUserName());
iOrgUsrService.updateById(orgUsr);
// 动态表单
List<AlertFormValue> alertFromValuelist = OrgPersonVo.getAlertFormValue();
......@@ -119,12 +126,25 @@ public class OrgPersonController {
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);
return ResponseHelper.buildResponse(null);
}
/**
* 根据id查询人员
*
......@@ -142,16 +162,18 @@ public class OrgPersonController {
List<AlertFormValue> list = iAlertFromValueService.list(queryWrapper);
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.isBlock());
if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text",
alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
formValue.add(value);
}else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValueCode(), alertFormValue.isBlock());
} else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text",
alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
formValue.add(value);
}
}
OrgPersonFormVo orgUsrFormVo = new OrgPersonFormVo();
BeanUtils.copyProperties(orgUsr,orgUsrFormVo);
BeanUtils.copyProperties(orgUsr, orgUsrFormVo);
orgUsrFormVo.setDynamicFormAlert(formValue);
return ResponseHelper.buildResponse(orgUsrFormVo);
}
......@@ -170,10 +192,10 @@ public class OrgPersonController {
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
Collection<OrgUsr> list = iOrgUsrService.listByMap(columnMap);
return ResponseHelper.buildResponse(iOrgUsrService.getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType"));
return ResponseHelper.buildResponse(iOrgUsrService.getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr",
2, "getBizOrgName", "getParentId", "getBizOrgType"));
}
/**
* 列表分页查询
*
......@@ -230,9 +252,10 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{orgCode}/users", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据orgCode查询", notes = "根据orgCode查询")
public ResponseModel selectUsersByOrgCode(HttpServletRequest request, String pageNum, String pageSize, @PathVariable Long orgCode) {
public ResponseModel selectUsersByOrgCode(HttpServletRequest request, String pageNum, String pageSize,
@PathVariable Long orgCode) {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete",CommonConstant.IS_DELETE_00);
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_code", orgCode);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
iOrgUsrService.listByMap(columnMap);
......@@ -252,7 +275,8 @@ public class OrgPersonController {
public ResponseModel downloadTemplate(HttpServletResponse response) throws UnsupportedEncodingException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
List<OrgUsrDownloadTemplateVO> OrgUsrDownloadTemplateVO = new ArrayList<>();
ExcelUtils.exportExcel(OrgUsrDownloadTemplateVO, "人员信息", "人员信息", OrgUsrDownloadTemplateVO.class, simpleDateFormat.format(new Date()) + ".xls", response);
ExcelUtils.exportExcel(OrgUsrDownloadTemplateVO, "人员信息", "人员信息", OrgUsrDownloadTemplateVO.class,
simpleDateFormat.format(new Date()) + ".xls", response);
return ResponseHelper.buildResponse(null);
}
}
......@@ -146,10 +146,10 @@ public class OrgUsrController extends BaseController {
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.isBlock());
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
formValue.add(value);
}else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValueCode(), alertFormValue.isBlock());
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValueCode(), alertFormValue.getIsBlock());
formValue.add(value);
}
}
......
......@@ -4,6 +4,9 @@ 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.mapper.AlertFormValueMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import java.util.List;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -16,4 +19,8 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class AlertFormValueServiceImpl extends BaseService<AlertFromValueDto,AlertFormValue,AlertFormValueMapper> implements IAlertFormValueService {
public List<AlertFromValueDto> queryByCalledId(Long alertCalledId) {
return this.queryForList(null, false, alertCalledId);
}
}
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