Commit dfdeb2c3 authored by tangwei's avatar tangwei

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 0cd45414 ff895e35
......@@ -76,7 +76,7 @@ public class AlertFormServiceImpl extends BaseService<AlertFromDto,AlertForm,Ale
return this.queryListByTypeCode(typeCode).stream().map(c -> c.getFieldCode()).collect(Collectors.toList());
}
private List<AlertFromDto> queryListByTypeCode(String alertTypeCode) {
public List<AlertFromDto> queryListByTypeCode(String alertTypeCode) {
return this.queryForList(null, false, alertTypeCode);
}
}
......@@ -9,6 +9,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
......@@ -24,6 +25,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.NameUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
......@@ -330,6 +332,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setRecUserName(oriOrgUsr.getRecUserName());
orgUsr.setAmosOrgId(oriOrgUsr.getAmosOrgId());
orgUsr.setAmosOrgCode(oriOrgUsr.getAmosOrgCode());
if (orgUsr.getParentId() != null && "-1".equals(orgUsr.getParentId())) {
OrgUsr parent = getById(orgUsr.getParentId());
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
updateById(orgUsr);
}
......@@ -372,6 +382,28 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
// 保存动态表单数据
alertFormValueServiceImpl.updateBatchById(alertFromValuelist);
List<AlertFromDto> form = alertFormServiceImpl.queryListByTypeCode(alertFromValuelist.get(0).getAlertTypeCode());
if (form.size() != alertFromValuelist.size()) {
List<AlertFormValue> creatList = new ArrayList<>();
for (AlertFormValue dis : alertFromValuelist) {
boolean exist = false;
for (AlertFromValueDto src : formList) {
if (dis.getAlertFormId() == src.getSequenceNbr()) {
exist = true;
break;
}
}
if (!exist) {
creatList.add(dis);
}
}
alertFormValueServiceImpl.saveBatch(creatList);
}
} else {
// 保存动态表单数据
alertFormValueServiceImpl.saveBatch(alertFromValuelist);
......@@ -408,6 +440,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgUsrVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
if (OrgUsrVo.getParentId() != null && "-1".equals(OrgUsrVo.getParentId())) {
OrgUsr parent = getById(OrgUsrVo.getParentId());
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
saveOrgUsrAlertFormValue(orgUsr, OrgUsrVo.getAlertFormValue());
}
......@@ -416,6 +456,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
if (OrgPersonVo.getParentId() != null && "-1".equals(OrgPersonVo.getParentId())) {
OrgUsr parent = getById(OrgPersonVo.getParentId());
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
OrgPersonVo.setAmosOrgCode(user.getRealName());
......@@ -430,6 +480,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgUsrVo, orgUsr);
if (orgUsr.getParentId() != null && "-1".equals(orgUsr.getParentId())) {
OrgUsr parent = getById(orgUsr.getParentId());
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
saveOrgUsr(oriOrgUsr, id);
// 保存动态表单数据
updateAlertFormValue(oriOrgUsr, orgUsr.getSequenceNbr(), OrgUsrVo.getAlertFormValue());
......@@ -554,6 +612,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_DEPARTMENT);
if (OrgDepartmentVo.getParentId() != null && "-1".equals(OrgDepartmentVo.getParentId())) {
OrgUsr parent = getById(OrgDepartmentVo.getParentId());
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
saveOrgUsrAlertFormValue(orgUsr, OrgDepartmentVo.getAlertFormValue());
}
......@@ -563,6 +629,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
if (orgUsr.getParentId() != null && "-1".equals(orgUsr.getParentId())) {
OrgUsr parent = getById(orgUsr.getParentId());
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
saveOrgUsr(oriOrgUsr, id);
// 保存动态表单数据
updateAlertFormValue(oriOrgUsr, orgUsr.getSequenceNbr(), OrgDepartmentVo.getAlertFormValue());
......@@ -588,4 +662,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
return personResult;
}
public static String getOrgCodeStr(){
int length = 6;
String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Random random=new Random();
StringBuffer sb=new StringBuffer();
for(int i=0;i<length;i++){
int number=random.nextInt(62);
sb.append(str.charAt(number));
}
return sb.toString();
}
}
......@@ -59,37 +59,40 @@ public class RuleAlertCalledService {
alertCalledRo.setUnitInvolved(alertCalled.getUnitInvolved());
List<AlertFormValue> alertFormValues = alertCalledVo.getAlertFormValue();
for (AlertFormValue alertFormValue : alertFormValues)
if (ValidationUtil.isEmpty(alertFormValues))
{
if (alertFormValue.getFieldCode().equals("alertSubmittedId"))
{
alertCalledRo.setAlertSubmittedId(alertFormValue.getFieldValue());
}
//一般火灾
if (alertFormValue.getFieldCode().equals("fireLocation"))
{
alertCalledRo.setFireLocation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("burningMaterial"))
{
alertCalledRo.setBurningMaterial(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("fireSituation"))
{
alertCalledRo.setFireSituation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("dangerousExplosives"))
{
alertCalledRo.setDangerousExplosives(alertFormValue.getFieldValue());
}
//航空器救援
//突发事件救援
//漏油现场安全保障
//专机保障
for (AlertFormValue alertFormValue : alertFormValues)
{
if (alertFormValue.getFieldCode().equals("alertSubmittedId"))
{
alertCalledRo.setAlertSubmittedId(alertFormValue.getFieldValue());
}
//一般火灾
if (alertFormValue.getFieldCode().equals("fireLocation"))
{
alertCalledRo.setFireLocation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("burningMaterial"))
{
alertCalledRo.setBurningMaterial(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("fireSituation"))
{
alertCalledRo.setFireSituation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("dangerousExplosives"))
{
alertCalledRo.setDangerousExplosives(alertFormValue.getFieldValue());
}
//航空器救援
//突发事件救援
//漏油现场安全保障
//专机保障
}
}
//触发规则
......
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