Commit a0d32870 authored by wujiang's avatar wujiang

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

parents fd64b430 bc137977
......@@ -2,21 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.IdxUjerMapper">
<select id="getPage" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.IdxUjerDto">
SELECT *, IF(b.id is null, '未建', '已建') as bizType
SELECT
a.`BUSINESS_NAME` as businessName,
a.`CREDIT_CODE` as creditCode,
a.`BUSINESS_TYPE` as businessType,
a.`BUSINESS_ADDRESS` as businessAddress,
a.`CONTACTS` as contacts,
a.`CONTACT_NUMBER` as contactNumber,
a.`COMPANYID` as companyId,
IF(b.SEQUENCE_NBR is null, '未建', '已建') as bizType
FROM idx_biz_odgu a
LEFT JOIN idx_biz_ujer b on a.business_name = b.business_name
LEFT JOIN idx_biz_ujer b on a.BUSINESS_NAME = b.BUSINESS_NAME
<where>
<if test="ids !=null and ids.size()>0">
AND a.companyId in
AND a.COMPANYID in
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="bizType=='yingjian'">
AND b.id is null
AND b.SEQUENCE_NBR is null
</if>
<if test="bizType=='yijian'">
AND b.id is not null
AND b.SEQUENCE_NBR is not null
</if>
</where>
</select>
......
......@@ -112,6 +112,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
TzsAuthService tzsAuthService;
@Value("${duty.seats.role.ids}")
private String dutySeatsRoleIds;
private final Logger logger = LogManager.getLogger(AlertCalledServiceImpl.class);
......@@ -388,7 +391,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Override
public List<DutySeatDto> getSeatInfos() {
// 获取人员信息
FeignClientResult<List<AgencyUserModel>> userListResult = Privilege.agencyUserClient.list(null,null);
// FeignClientResult<List<AgencyUserModel>> userListResult = Privilege.agencyUserClient.list(null,null);
FeignClientResult<List<AgencyUserModel>> userListResult = Privilege.agencyUserClient.queryByRoleId(dutySeatsRoleIds,null);
List<AgencyUserModel> userList = userListResult.getResult();
List<DutySeatDto> dutyList = new ArrayList<>();
userList.stream().forEach(u -> {
......
......@@ -132,7 +132,7 @@ public class InspectionServiceImpl implements InspectionService {
@Override
public JSONObject getSafetySupervisionCode(String bizTable) {
String safetySupervisionCode = "(%s)市监特令中[%s]第 %s 号";
String safetySupervisionCode = "(%s)市监特令中[%s]第 %s 号";
AgencyUserModel agencyUserModel = Privilege.agencyUserClient.getme().getResult();
Object reginSeq = JsonValueUtils.getValueByKey(JSONObject.parse(JSON.toJSONString(agencyUserModel)), "companys", "companys.0.regionSeq");
String region = "";
......@@ -208,7 +208,7 @@ public class InspectionServiceImpl implements InspectionService {
}
});
JSONObject jsonObject = new JSONObject();
String selectSql = "SELECT * FROM " + tableName + " WHERE type=" + StringUtils.str2sqlValue(type);
String selectSql = "SELECT * FROM " + tableName + " WHERE TYPE=" + StringUtils.str2sqlValue(type);
Map<String, Object> objectMap = bizJdbcTemplate.queryForMap(selectSql);
result.forEach(x -> {
String regionName = columMap.get(x.getRegionName());
......
......@@ -53,4 +53,5 @@ rule.definition.model-package=com.yeejoin.amos.boot.module.tzs.api.dto
rule.definition.default-agency=tzs
rule.definition.localIp=172.16.3.39
org.filter.group.seq=1564150103147573249
\ No newline at end of file
org.filter.group.seq=1564150103147573249
duty.seats.role.ids=1585956200472674305,1585956257590706177
\ No newline at end of file
......@@ -9,17 +9,17 @@ import java.util.HashMap;
@Getter
@AllArgsConstructor
public enum OrgEnum {
公司("COMPANY", "244", "公司",1),
部门("DEPARTMENT", "245", "部门",2),
普通人员("PERSON", "246", "普通人员",3),
焊工("WELDER","247","焊工",3),
建设单位负责人("CHARGE","254","建设单位负责人",3),
企业管理员("ADMIN","248","企业管理员",3),
建设单位("CONSTRUCTION","249","建设单位",1),
安装单位("INSTALL","250","安装单位",1),
设计单位("DESIGN","251","设计单位",1),
监察部门("SUPERVISION","252","监察部门",1),
监检机构("MONITORING","253","监检机构",1);
公司("COMPANY", "244", "公司",1,"studio_normalapp_4403119"),
部门("DEPARTMENT", "245", "部门",2,"studio_normalapp_4403119"),
普通人员("PERSON", "246", "普通人员",3,"studio_normalapp_4403119"),
焊工("WELDER","247","焊工",3,"studio_normalapp_4403119"),
建设单位负责人("CHARGE","254","建设单位负责人",3,"studio_normalapp_4403119"),
企业管理员("ADMIN","248","企业管理员",3,"studio_normalapp_4403119"),
建设单位("CONSTRUCTION","249","建设单位",1,"studio_normalapp_4403119"),
安装单位("INSTALL","250","安装单位",1,"studio_normalapp_4403119"),
设计单位("DESIGN","251","设计单位",1,"studio_normalapp_4403119"),
监察部门("SUPERVISION","252","监察部门",1,"studio_normalapp_4403119"),
监检机构("MONITORING","253","监检机构",1,"studio_normalapp_4403119");
private String key;
private String code;
......@@ -28,12 +28,14 @@ public enum OrgEnum {
* 1 公司 2 部门 3 人员
*/
private Integer type;
private String appCode;
public static HashMap<String,String> map= new HashMap();
public static HashMap<String, String> codeMap = new HashMap();
static {
for(OrgPersonEnum orgPersonEnum:OrgPersonEnum.values()){
for(OrgEnum orgPersonEnum:OrgEnum.values()){
map.put(orgPersonEnum.getKey(),orgPersonEnum.getName());
codeMap.put(orgPersonEnum.getKey(),orgPersonEnum.getAppCode());
}
}
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -20,6 +21,7 @@ public class EquipmentDto extends BaseDto {
private static final long serialVersionUID = 1L;
Equipment equipment;
@ApiModelProperty(value = "名称")
private String name;
......
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -22,6 +24,7 @@ public class ProjectDto extends BaseDto {
private static final long serialVersionUID = 1L;
Project project;
@ApiModelProperty(value = "项目名称")
private String name;
......
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 设备信息表 Mapper 接口
*
......@@ -12,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface EquipmentMapper extends BaseMapper<Equipment> {
IPage<EquipmentDto> queryEquipmentPage(IPage<EquipmentDto> page, Equipment equipment);
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
......@@ -22,5 +25,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
ProjectDto selectOneByName(@RequestParam String name);
ProjectDto getDetail(Long sequenceNbr);
//项目模糊筛选
List<ProjectDto> queryProjectPage(Project projectParam);
}
......@@ -2,8 +2,10 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -14,9 +16,11 @@ import java.util.List;
* @author system_generator
* @date 2022-09-22
*/
public interface IEquipmentService {
//添加设备+附件
EquipmentDto saveEI(JSONObject object);
IPage<EquipmentDto> queryEquipmentPage(IPage<EquipmentDto> page,Equipment equipment);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
/**
* 项目信息表接口类
*
......@@ -8,5 +14,5 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
*/
public interface IProjectService {
Page<ProjectDto> queryProjectPage(int current, int size, Project project);
}
......@@ -2,4 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper">
<select id="queryEquipmentPage" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Equipment">
select * from tz_ugp_equipment
<where>
<if test="equipment.name != '' and equipment.name != null">
and `name` like concat('%',#{equipment.name},'%')
</if>
<if test="equipment.code != '' and equipment.code != null">
and `code` like concat('%',#{equipment.code},'%')
</if>
<if test="equipment.verifyStatus != '' and equipment.verifyStatus != null">
and `verify_status` like concat('%',#{equipment.verifyStatus},'%')
</if>
</where>
</select>
</mapper>
......@@ -17,4 +17,16 @@
LEFT JOIN cb_org_usr AS ou2 ON ou2.sequence_nbr = r.supervise_dept_id
WHERE p.sequence_nbr = #{sequenceNbr}
</select>
<select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Project">
select * from tz_ugp_project
<where>
<if test="name != '' and name != null">
and `name` like concat('%',#{name},'%')
</if>
<if test="constructionUnit != '' and constructionUnit != null">
and `construction_Unit` like concat('%',#{constructionUnit},'%')
</if>
</where>
</select>
</mapper>
......@@ -506,5 +506,18 @@ public class CompanyController extends BaseController {
}
/**
* 验证手机号验证码是否成功
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/tset")
@ApiOperation(httpMethod = "GET", value = "验证手机号验证码是否成功", notes = "验证手机号验证码是否成功")
public void tset() {
orgServiceImpl.getReginParams();
}
}
......@@ -4,8 +4,12 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
......@@ -20,6 +24,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -46,6 +52,7 @@ public class EquipmentController extends BaseController {
@Autowired
EquipmentServiceImpl equipmentServiceImpl;
@Autowired
EquipmentMapper equipmentMapper;
......@@ -112,28 +119,26 @@ public class EquipmentController extends BaseController {
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "设备信息表分页查询", notes = "设备信息表分页查询")
public ResponseModel<Page<EquipmentDto>> queryForPage(
public ResponseModel<IPage<EquipmentDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "code",required = false) String code,
@RequestParam(value = "verifyStatus",required = false)String verifyStatus) {
Page<EquipmentDto> page = new Page<EquipmentDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(equipmentServiceImpl.queryForEquipmentPage(page,name,code,verifyStatus));
@RequestParam(value = "size") int size, Equipment equipment) {
IPage<EquipmentDto> page = new Page<>();
page.setSize(size);
page.setCurrent(current);
return ResponseHelper.buildResponse(equipmentServiceImpl.queryEquipmentPage(page,equipment));
}
/**
* 列表全部数据查询
*
......
......@@ -8,9 +8,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*;
import org.springframework.beans.BeanUtils;
......@@ -131,14 +133,9 @@ public class ProjectController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "项目信息表分页查询", notes = "项目信息表分页查询")
public ResponseModel<Page<ProjectDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "constructionUnit",required = false) String constructionUnit
) {
Page<ProjectDto> page = new Page<ProjectDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(projectServiceImpl.queryForProjectPage(page, name, constructionUnit));
@RequestParam(value = "size") int size, Project project) {
return ResponseHelper.buildResponse(projectServiceImpl.queryProjectPage(current,size,project));
}
/**
......@@ -215,9 +212,8 @@ public class ProjectController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "项目审核", notes = "项目审核")
@PostMapping(value = "/processProject")
public ResponseModel<String> processProject(String sequenceNbr,@RequestBody JSONObject json){
String option = json.getString(XJConstant.PROCESS_PROJECT_STATE);
@GetMapping(value = "/processProject")
public ResponseModel<String> processProject(String sequenceNbr,String option){
Project project = projectServiceImpl.getById(sequenceNbr);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(project));
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"审核不通过");
......
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.UserDto;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
......@@ -65,7 +66,7 @@ public class WelderController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/saveWelder", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增人员信息", notes = "新增人员信息")
public ResponseModel<OrgUsrDto> saveWelder(@RequestBody JSONObject jsonObject, @RequestParam String bizOrgType ,
......@@ -129,12 +130,27 @@ public class WelderController extends BaseController {
@GetMapping(value = "/getCompanyWelder")
public ResponseModel<IPage> getCompanyWelder(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size
@RequestParam(value = "size") int size,
@RequestParam(required = false) String name,
@RequestParam(required = false) String idNumber,
@RequestParam(required = false) String licensedProject
){
Page page = new Page();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(orgServiceImpl.getCompanyWelder(page));
IPage companyWelder = orgServiceImpl.getCompanyWelder(page);
List<WelderDto> welderRecords = companyWelder.getRecords();
//模糊查询
if (name!=null||idNumber!=null||licensedProject!=null){
if (name!=null) {welderRecords = welderRecords.stream().filter(n -> n.getName().indexOf(name)>-1).collect(Collectors.toList());}
if (idNumber!=null) {welderRecords = welderRecords.stream().filter(n -> n.getIdNumber().indexOf(idNumber)>-1).collect(Collectors.toList());}
if (licensedProject!=null) {welderRecords = welderRecords.stream().filter(n -> n.getLicensedProject().indexOf(licensedProject)>-1).collect(Collectors.toList());}
}
Page records = page.setRecords(welderRecords);
return ResponseHelper.buildResponse(records);
}
/**
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.framework;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -42,13 +43,14 @@ public class BusinessIdentifyAspect {
@Before(value = "@annotation(com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, BusinessIdentify permission) throws PermissionException {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (permission.isNeedIdentity() && reginParam != null) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (permission.isNeedIdentity() && reginParams != null) {
ReginParams.BusinessInfo businessInfo = new ReginParams.BusinessInfo();
//company
Long amosBizCode = reginParams.getCompany().getSequenceNbr();
OrgUsr companyOrgUsr = orgUsrService.getById(amosBizCode);
Long amosOrgId= reginParams.getCompany().getSequenceNbr();
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,amosOrgId);
OrgUsr companyOrgUsr = orgUsrService.getOne(wrapper);
String companyName = companyOrgUsr.getBizOrgName();
Long companySequenceNbr = companyOrgUsr.getSequenceNbr();
String companyType = companyOrgUsr.getOrgExpandAttr1();
......@@ -56,13 +58,15 @@ public class BusinessIdentifyAspect {
companyType = companyOrgUsr.getBizOrgType();
}
businessInfo.setCompanyName(companyName);
businessInfo.setAmosBizCode(amosBizCode);
businessInfo.setAmosBizCode(amosOrgId);
businessInfo.setCompanyType(companyType);
businessInfo.setCompanySequenceNbr(companySequenceNbr);
//User
Long amosUserCode = reginParams.getUserModel().getSequenceNbr();
OrgUsr userOrgUsr = orgUsrService.getById(amosUserCode);
amosOrgId = reginParams.getUserModel().getSequenceNbr();
wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr::getAmosOrgId,amosOrgId);
OrgUsr userOrgUsr = orgUsrService.getOne(wrapper);
String userName = userOrgUsr.getBizOrgName();
Long userSequenceNbr = userOrgUsr.getSequenceNbr();
String userType = userOrgUsr.getOrgExpandAttr1();
......@@ -72,8 +76,9 @@ public class BusinessIdentifyAspect {
businessInfo.setUserSequenceNbr(userSequenceNbr);
businessInfo.setUserName(userName);
businessInfo.setUserType(userType);
businessInfo.setAmosUserCode(amosUserCode);
businessInfo.setAmosUserCode(amosOrgId);
reginParams.setBusinessInfo(businessInfo);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParams));
}
}
......
......@@ -117,6 +117,8 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
List<Long> roleIds = new ArrayList<>();
Map<Long, List<Long>> roleSeqsMap = new HashMap<>();
Map<Long,List<RoleModel>> orgRoles = new HashMap<>();
Set<String> appCodeSet = new HashSet<>();
Company company = this.getById(sequenceNbr);
company.setApproved(model.getApproved());
......@@ -140,8 +142,18 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
String[] unitTypeCodes = company.getType().split(",");
for(String code : unitTypeCodes) {
roleNameSet.add(OrgEnum.map.get(code));
if(!appCodeSet.contains(OrgEnum.codeMap.get(code))){
appCodeSet.add(OrgEnum.codeMap.get(code));
}
}
userRoleList = allRoleList.stream().filter(r -> r.getRoleName().equals(roleNameSet)).collect(Collectors.toList());
Iterator iterator = roleNameSet.iterator();
allRoleList.stream().forEach(r -> {
if(roleNameSet.contains(r.getRoleName())){
userRoleList.add(r);
}
});
userRoleList.stream().forEach(r -> {
roleIds.add(r.getSequenceNbr());
});
......@@ -162,7 +174,9 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
agencyUserModel.setUserName(adminLoginName);
agencyUserModel.setPassword(DesUtil.encode(adminPassword, secretKey));
agencyUserModel.setRePassword(DesUtil.encode(adminPassword, secretKey));
Privilege.agencyUserClient.create(agencyUserModel);
List<String> appCodes = new ArrayList<>(appCodeSet);
agencyUserModel.setAppCodes(appCodes);
agencyUserModel = Privilege.agencyUserClient.create(agencyUserModel).getResult();
//企业动态表单存储
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(company));
......@@ -171,11 +185,12 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
orgServiceImpl.dataHandling(jsonObject,bizOrgType,null);
//企业管理员人员 动态表单存储
jsonObject = null;
jsonObject = new JSONObject();
jsonObject.put("name",adminName);
jsonObject.put("phone",adminPhone);
jsonObject.put("amosOrgId",agencyUserModel.getSequenceNbr());
orgServiceImpl.dataHandling(jsonObject, OrgEnum.企业管理员.getKey(),null);
jsonObject.put("isCheck",companyModelFeignClient.getSequenceNbr());
orgServiceImpl.dataHandling(jsonObject, OrgEnum.普通人员.getKey(),null);
}
return this.updateById(company);
}
......
......@@ -5,19 +5,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
......@@ -25,7 +22,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 设备信息表服务实现类
......@@ -97,31 +93,31 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
*/
public void saveAttachment(JSONArray subForm,Long SequenceNbr){
AttachmentDto attachmentDto = new AttachmentDto();
attachmentDto.setInfo(JSON.toJSONString(subForm));
attachmentDto.setSourceId(SequenceNbr);
if (!subForm.isEmpty()){
for(Object o:subForm){
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o));
jsonObject.getString("Symbol_key");
JSONArray jsonArray = jsonObject.getJSONArray("info");
for(Object j:jsonArray){
JSONObject info = JSON.parseObject(JSON.toJSONString(j));
String name = info.getString("name");
attachmentDto.setSourceId(SequenceNbr);
attachmentDto.setName(info.getString("name"));
// attachmentDto.setInfo("name: "+name+","+
// "type: "+name.substring(name.lastIndexOf(".")+1)+","+
// "path: "+info.getString("url")+","+
// "certCode: "+jsonObject.getString("certCode")+","+
// "certType: "+jsonObject.getString("certType"));
attachmentDto.setInfo(JSON.toJSONString(subForm));
attachmentDto.setType(name.substring(name.lastIndexOf(".")+1));
attachmentServiceImpl.createWithModel(attachmentDto);
if(!ValidationUtil.isEmpty(jsonArray)) {
for (Object j : jsonArray) {
JSONObject info = JSON.parseObject(JSON.toJSONString(j));
String name = info.getString("name");
attachmentDto.setName(info.getString("name"));
attachmentDto.setType(name.substring(name.lastIndexOf(".")+1));
break;
}
break;
}
}
attachmentServiceImpl.createWithModel(attachmentDto);
}
}
@Override
public EquipmentDto saveEI(JSONObject object) {
EquipmentDto model = new EquipmentDto();
......@@ -172,6 +168,10 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
// BeanUtils.copyProperties(attachmentDto,attachment);
}
//设备模糊筛选
public IPage<EquipmentDto> queryEquipmentPage(IPage<EquipmentDto> page, Equipment equipment) {
return equipmentMapper.queryEquipmentPage(page,equipment);
}
}
\ No newline at end of file
......@@ -122,9 +122,6 @@ public class OrgServiceImpl {
}
}
orgUsr.setRecDate(new Date());
AgencyUserModel user = Privilege.agencyUserClient.getme().getResult();
orgUsr.setRecUserName(user.getRealName());
orgUsr.setRecUserId(user.getUserId());
orgUsr.setBizOrgName(jsonObject.getString("name"));
orgUsr.setSequenceNbr(jsonObject.getLong("sequenceNbr"));
orgUsr.setBizOrgType(bizOrgType);
......@@ -136,12 +133,21 @@ public class OrgServiceImpl {
orgUsr.setBizOrgCode(jsonObject.getString("creditCode"));
}
if (OrgEnum.普通人员.getKey().equals(bizOrgType)){
if (1==jsonObject.getInteger("isWelder")) {
orgUsr.setOrgExpandAttr1(OrgEnum.焊工.getKey());
orgUsr.setCode(getCode());
if(!ValidationUtil.isEmpty(jsonObject.getInteger("isWelder"))){
if(ValidationUtil.isEmpty(sequenceNbr)){
if (1==jsonObject.getInteger("isWelder")) {
orgUsr.setOrgExpandAttr1(OrgEnum.焊工.getKey());
orgUsr.setCode(getCode());
}
}
}
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(reginParams.getCompany().getSequenceNbr()));
if (!ValidationUtil.isEmpty(jsonObject.getLong("isCheck"))) {
wrapper.eq(OrgUsr :: getAmosOrgId,jsonObject.getLong("isCheck"));
} else {
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(reginParams.getCompany().getSequenceNbr()));
}
orgUsr.setParentId(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()));
}
if (OrgEnum.部门.getKey().equals(bizOrgType)) {
......@@ -171,7 +177,7 @@ public class OrgServiceImpl {
if(ValidationUtil.isEmpty(code)){
c = 0001;
}else{
c = Integer.parseInt(code)+1;
c = Integer.parseInt(code.substring(code.indexOf("-"),code.length() - 1))+1;
}
String welderCode = OrgEnum.焊工.getKey() +"-"+ c;
......@@ -252,8 +258,7 @@ public class OrgServiceImpl {
*/
public IPage getCompanyWelder(IPage page){
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()))
.eq(OrgUsr::getBizOrgType,OrgEnum.焊工.getKey());
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()));
return getInfo(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()),page);
}
......@@ -263,8 +268,7 @@ public class OrgServiceImpl {
*/
public IPage getCompanyDept(IPage page){
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()))
.eq(OrgUsr::getBizOrgType,OrgEnum.部门.getKey());
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()));
return getInfo(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()),page);
}
......@@ -286,11 +290,10 @@ public class OrgServiceImpl {
* 查询当前登录单位下的人员列表
* @return
*/
@BusinessIdentify
public List<OrgUsr> getCharge(){
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()));
LambdaQueryWrapper<OrgUsr> personWrapper = new LambdaQueryWrapper<>();
personWrapper.eq(OrgUsr::getParentId,orgUsrServiceImpl.getOne(wrapper).getSequenceNbr())
personWrapper.eq(OrgUsr::getParentId,String.valueOf(getReginParams().getBusinessInfo().getCompanySequenceNbr()))
.eq(OrgUsr :: getBizOrgType,OrgEnum.普通人员.getKey());
return orgUsrServiceImpl.list(personWrapper);
}
......
......@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
......@@ -60,9 +59,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
WorkflowExcuteServiceImpl workflowExcuteService;
@Autowired
WorkflowFeignService workflowFeignService;
@Autowired
InstallNoticeMsgServiceImpl installNoticeMsgService;
@Autowired
......@@ -122,18 +118,15 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Override
public void execute(String instanceId,Object objectd, String option){
JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectd));
JSONObject jsonObject = workflowFeignService.getTask(instanceId);
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
ProjectInitiation projectInitiation = new ProjectInitiation();
projectInitiation.setInstanceId(instanceId);
projectInitiation.setContext(JSON.toJSONString(objectd));
JSONObject dataObject = jsonObject.getJSONObject("data");
projectInitiation.setTaskId(dataObject.getString("id"));
projectInitiation.setTaskName(dataObject.getString("name"));
if (ProjectInitiationEnum.平台审核.getName().equals(dataObject.getString("name"))) {
if (true) {
option = "1";
}
}
if(ProjectInitiationEnum.监检员审核.getName().equals(dataObject.getString("name"))){
......@@ -189,10 +182,11 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
* @return
*/
public String getFlowTaskName(String instanceId){
JSONObject jsonObject = workflowFeignService.getTask(instanceId);
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskName = "流程结束!";
try {
taskName=jsonObject.getJSONObject("data").getString("name");
taskName=jsonObject.getString("name");
}catch (Exception e) {}
return taskName;
}
......@@ -201,7 +195,8 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Project::getInstanceId,instanceId);
Project project = projectService.getOne(wrapper);
project.setStatus(ProjectInitiationEnum.getCodeByNameMap.get(getFlowTaskName(instanceId)));
// project.setStatus(ProjectInitiationEnum.getCodeByNameMap.get(getFlowTaskName(instanceId)));
project.setStatus(getFlowTaskName(instanceId));
projectService.updateById(project);
}
......
......@@ -45,6 +45,8 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
EquipmentServiceImpl equipmentService;
@Autowired
AttachmentServiceImpl attachmentServiceImpl;
/**
* 分页查询
*/
......@@ -165,4 +167,16 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
this.updateById(project);
return "ok";
}
//项目模糊筛选
public Page<ProjectDto> queryProjectPage(int current, int size, Project project) {
Page<ProjectDto> page = new Page<>();
page.setSize(size);
page.setCurrent(current);
this.list();
List<ProjectDto> projects = projectMapper.queryProjectPage(project);
page.setRecords(projects);
return page;
}
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ fire-rescue=123
params.work.flow.processDefinitionKey=xiangmulixiangliucheng
params.work.flow.problemDefinitionKey=zhiliangwentiliucheng
amos.secret.key=ugp
amos.secret.key=qaz
ugp.sms.tempCode=SMS_UGP_0007
......@@ -39,4 +39,6 @@ ugp.sms.tempCode=SMS_UGP_0007
#logging.level.com.yeejoin.amos=error
amos.system.user.user-name=ugp_cti
amos.system.user.password=a1234567
\ No newline at end of file
amos.system.user.password=a1234567
amos.system.user.product=AMOS_STUDIO_WEB
amos.system.user.app-key=AMOS_STUDIO
\ No newline at end of file
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