Commit 73daa52a authored by tangwei's avatar tangwei

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

parents c2e00b14 5b0f24e3
......@@ -2,7 +2,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-biz-common</artifactId>
<name>AMOS-BOOT-BIZ-COMMON</name>
<packaging>jar</packaging>
<properties>
......
......@@ -29,20 +29,21 @@
cb_org_usr u LEFT JOIN
jc_alert_form_value v on u.sequence_nbr = v.alert_called_id
LEFT JOIN jc_alert_form f ON f.sequence_nbr = v.alert_form_id
where u.parent_id = #{parentId}
AND u.biz_org_type = #{bizOrgType}
AND U.is_delete = 0
where
u.biz_org_type = #{bizOrgType}
AND u.is_delete = 0
<if test="bizOrgName != null">
AND u.biz_org_name = #{bizOrgName}
</if>
<if test="bizOrgCode != null and bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
)a where a.sequenceNbr is not null
<if test="bizOrgName != null">
AND u.bizOrgName = #{bizOrgName}
</if>
<if test="bizOrgCode != null">
AND u.bizOrgName = #{bizOrgCode}
</if>
<if test="fieldsValue != null">
<foreach collection="fieldsValue.keys" item="item"> AND a.${item} = #{fieldsValue[${item}]} </foreach>
</if>
......@@ -63,20 +64,20 @@
cb_org_usr u LEFT JOIN
jc_alert_form_value v on u.sequence_nbr = v.alert_called_id
LEFT JOIN jc_alert_form f ON f.sequence_nbr = v.alert_form_id
where u.parent_id = #{parentId}
AND u.biz_org_type = #{bizOrgType}
AND U.is_delete = 0
where
u.biz_org_type = #{bizOrgType}
AND u.is_delete = 0
<if test="bizOrgName != null">
AND u.biz_org_name = #{bizOrgName}
</if>
<if test="bizOrgCode != null and bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
)a where a.sequenceNbr is not null
<if test="bizOrgName != null">
AND u.bizOrgName = #{bizOrgName}
</if>
<if test="bizOrgCode != null">
AND u.bizOrgName = #{bizOrgCode}
</if>
<if test="fieldsValue != null">
<foreach collection="fieldsValue.keys" item="item" > AND a.${item} = #{fieldsValue[${item}]} </foreach>
</if>
......@@ -114,6 +115,7 @@
SELECT
sequence_nbr,
biz_org_name,
biz_org_code,
biz_org_type,
parent_id
FROM
......
......@@ -17,7 +17,7 @@
<modules>
<module>amos-boot-module-tzs-api</module>
<module>amos-boot-module-jcs-api</module>
<module>amos-boot-module-demo-api</module>
<module>amos-boot-module-common-api</module>
<!-- <module>amos-boot-module-demo-api</module>
<module>amos-boot-module-common-api</module> -->
</modules>
</project>
\ No newline at end of file
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
......@@ -24,7 +23,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;
......@@ -34,20 +32,17 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.enums.OrgPersonEnum;
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.*;
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.OrgDepartmentFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.lang.reflect.Method;
import java.util.*;
import java.util.stream.Collectors;
/**
* 机构/部门/人员表 服务实现类
......@@ -249,6 +244,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return list == null ? new ArrayList<Map<String, Object>>() : list;
}
public IPage<Map<String, Object>> pagePerson(String pageNum, String pageSize, Map<String, Object> req) {
IPage<Map<String, Object>> pageBean = null;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
......@@ -261,7 +258,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (!ObjectUtils.isEmpty(req.get("bizOrgName"))) {
map.put("bizOrgName", req.get("bizOrgName"));
}
map.put("parentId", req.get("parentId"));
OrgUsr parent = this.getById( Long.valueOf(req.get("parentId").toString()));
map.put("bizOrgCode", parent.getBizOrgCode());
req.remove("bizOrgName");
req.remove("pageSize");
req.remove("pageNum");
......@@ -318,7 +316,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setRecUserName(oriOrgUsr.getRecUserName());
orgUsr.setAmosOrgId(oriOrgUsr.getAmosOrgId());
orgUsr.setAmosOrgCode(oriOrgUsr.getAmosOrgCode());
if (oriOrgUsr.getParentId() != null && !"-1".equals(oriOrgUsr.getParentId())) {
if (oriOrgUsr.getParentId() != null) {
OrgUsr parent = getById(oriOrgUsr.getParentId());
if (parent != null && ObjectUtils.isEmpty(oriOrgUsr.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
......@@ -339,6 +337,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
save(orgUsr);
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
if (OrgPersonEnum.公司.getKey().equals(orgUsr.getBizOrgType())) {
alertFromValue.setAlertTypeCode(OrgPersonEnum.公司.getCode());
} else if (OrgPersonEnum.部门.getKey().equals(orgUsr.getBizOrgType())) {
alertFromValue.setAlertTypeCode(OrgPersonEnum.部门.getCode());
}
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
// 保存动态表单数据
......@@ -362,6 +365,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
dis.setRecUserName(orgUsr.getRecUserName());
dis.setAlertTypeCode(src.getAlertTypeCode());
dis.setAlertFormId(src.getAlertFormId());
dis.setSequenceNbr(src.getSequenceNbr());
break;
}
}
......@@ -369,7 +373,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 保存动态表单数据
alertFormValueServiceImpl.updateBatchById(alertFromValuelist);
List<AlertFromDto> form = alertFormServiceImpl.queryListByTypeCode(alertFromValuelist.get(0).getAlertTypeCode());
List<AlertFromDto> form = alertFormServiceImpl.queryListByTypeCode(formList.get(0).getAlertTypeCode());
if (form.size() != alertFromValuelist.size()) {
......@@ -383,7 +387,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
break;
}
}
if (!exist) {
if (ObjectUtils.isEmpty(dis) && !exist) {
creatList.add(dis);
}
}
......@@ -431,7 +435,7 @@ 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())) {
if (OrgUsrVo.getParentId() != null) {
OrgUsr parent = getById(OrgUsrVo.getParentId());
if (parent != null && ObjectUtils.isEmpty(OrgUsrVo.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
......@@ -447,7 +451,7 @@ 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())) {
if (OrgPersonVo.getParentId() != null) {
OrgUsr parent = getById(OrgPersonVo.getParentId());
if (parent != null && ObjectUtils.isEmpty(OrgPersonVo.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
......@@ -471,7 +475,7 @@ 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())) {
if (orgUsr.getParentId() != null) {
OrgUsr parent = getById(orgUsr.getParentId());
if (parent != null && ObjectUtils.isEmpty(OrgUsrVo.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
......@@ -603,7 +607,7 @@ 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())) {
if (OrgDepartmentVo.getParentId() != null) {
OrgUsr parent = getById(OrgDepartmentVo.getParentId());
if (parent != null && ObjectUtils.isEmpty(OrgDepartmentVo.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
......@@ -620,7 +624,7 @@ 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())) {
if (orgUsr.getParentId() != null) {
OrgUsr parent = getById(orgUsr.getParentId());
if (parent != null && ObjectUtils.isEmpty(OrgDepartmentVo.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
......
......@@ -16,7 +16,7 @@
<modules>
<module>amos-boot-module-tzs-biz</module>
<module>amos-boot-module-jcs-biz</module>
<module>amos-boot-module-demo-biz</module>
<module>amos-boot-module-common-biz</module>
<!--<module>amos-boot-module-demo-biz</module>
<module>amos-boot-module-common-biz</module>-->
</modules>
</project>
\ No newline at end of file
......@@ -2,7 +2,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-tzs-system</artifactId>
<name>SpecialEquipmentServiceStart</name>
<packaging>jar</packaging>
<parent>
......
......@@ -188,6 +188,6 @@
<module>amos-boot-jcs-system</module>
<module>amos-boot-biz-common</module>
<module>amos-boot-module</module>
<module>amos-boot-demo-system</module>
<!-- <module>amos-boot-demo-system</module> -->
</modules>
</project>
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