提交代码
parent
31ae5e42a7
commit
b0cd65d526
|
@ -113,5 +113,11 @@
|
|||
<artifactId>swagger-annotations</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Belerweb Pinyin4j -->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -72,4 +72,9 @@ public class CacheConstants
|
|||
* 限流 redis key
|
||||
*/
|
||||
public static final String RATE_LIMIT_KEY = "rate_limit:";
|
||||
|
||||
/**
|
||||
* 项目管理 cache key
|
||||
*/
|
||||
public static final String PRO_PROJECT = "pro_project:";
|
||||
}
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
* 审批状态
|
||||
*/
|
||||
public enum TaskStatus {
|
||||
public enum ApproveStatus {
|
||||
|
||||
check(10L, "审核中"),
|
||||
finish(99L, "已结束"),
|
||||
active(100L, "发布中");
|
||||
refuse(11L, "审核驳回"),
|
||||
exempt(100L, "审核通过"),
|
||||
passed(101L, "系统免审");
|
||||
|
||||
private final Long code;
|
||||
private final String info;
|
||||
|
||||
TaskStatus (Long code, String info)
|
||||
ApproveStatus(Long code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
|
@ -1,23 +1,22 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
|
||||
/**
|
||||
* 雇主类型
|
||||
* 证件类型
|
||||
*/
|
||||
public enum OwnerType {
|
||||
public enum CardTypeEnums {
|
||||
|
||||
GR(1L, "个人"),
|
||||
QY(2L, "企业");
|
||||
SFZ("1", "身份证");
|
||||
|
||||
private final Long code;
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
OwnerType (Long code, String info)
|
||||
CardTypeEnums(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Long getCode()
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
@ -26,5 +25,4 @@ public enum OwnerType {
|
|||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
/**
|
||||
* 注册渠道
|
||||
*
|
||||
* @author ZhouJiXiang
|
||||
*/
|
||||
public enum RegisterChannelEnums {
|
||||
WXMINI(0L, "微信小程序");
|
||||
|
||||
private final Long code;
|
||||
private final String info;
|
||||
|
||||
RegisterChannelEnums(Long code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Long getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
|
||||
/**
|
||||
* 报名入围类型
|
||||
*
|
||||
* @author JiangYuQi
|
||||
*/
|
||||
public enum SignUpTypeEnums {
|
||||
|
||||
HX(1L, "雇主海选"),
|
||||
ZJ(2L, "用户自荐");
|
||||
|
||||
private final Long code;
|
||||
private final String info;
|
||||
|
||||
SignUpTypeEnums (Long code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Long getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
public enum UserTypeEnums {
|
||||
|
||||
ZSRY("00", "正式人员"),
|
||||
LSRY("08", "临时人员"),
|
||||
FBDL("80", "分包代理"),
|
||||
FBRY("81", "分包人员");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
UserTypeEnums(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
|
@ -659,4 +659,32 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据身份证号判断性别
|
||||
* @param idNumber
|
||||
* @return
|
||||
*/
|
||||
public static String judgeGender(String idNumber) throws IllegalArgumentException{
|
||||
System.out.println(idNumber.length());
|
||||
if(idNumber.length() != 18 && idNumber.length() != 15){
|
||||
return "2";
|
||||
}
|
||||
int gender = 0;
|
||||
if(idNumber.length() == 18){
|
||||
//如果身份证号18位,取身份证号倒数第二位
|
||||
char c = idNumber.charAt(idNumber.length() - 2);
|
||||
gender = Integer.parseInt(String.valueOf(c));
|
||||
}else{
|
||||
//如果身份证号15位,取身份证号最后一位
|
||||
char c = idNumber.charAt(idNumber.length() - 1);
|
||||
gender = Integer.parseInt(String.valueOf(c));
|
||||
}
|
||||
System.out.println("gender = " + gender);
|
||||
if(gender % 2 == 1){
|
||||
return "0";
|
||||
}else{
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,9 @@ public class ProProjectInfo extends BaseEntity
|
|||
@Excel(name = "项目区县")
|
||||
private String projectRegional;
|
||||
|
||||
/** 项目包名 */
|
||||
private String projectPackage;
|
||||
|
||||
/** 项目地址 */
|
||||
@Excel(name = "项目地址")
|
||||
private String projectAddress;
|
||||
|
@ -477,6 +480,14 @@ public class ProProjectInfo extends BaseEntity
|
|||
this.projectDeptsList = projectDeptsList;
|
||||
}
|
||||
|
||||
public String getProjectPackage() {
|
||||
return projectPackage;
|
||||
}
|
||||
|
||||
public void setProjectPackage(String projectPackage) {
|
||||
this.projectPackage = projectPackage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
@ -37,10 +37,6 @@ public class ProProjectInfoSubdepts extends BaseEntity
|
|||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/** 分包单位 */
|
||||
@Excel(name = "分包单位")
|
||||
private Long subDeptId;
|
||||
|
||||
/** 分包单位类型 */
|
||||
@Excel(name = "分包单位类型")
|
||||
private String subDeptType;
|
||||
|
@ -69,6 +65,17 @@ public class ProProjectInfoSubdepts extends BaseEntity
|
|||
@Excel(name = "负责人电话")
|
||||
private String subDeptLeaderPhone;
|
||||
|
||||
/** 委托书 */
|
||||
@Excel(name = "委托书")
|
||||
private String subDeptLeaderPowerPath;
|
||||
|
||||
/** 营业执照 */
|
||||
@Excel(name = "营业执照")
|
||||
private String businessLicensePath;
|
||||
|
||||
/** 单位详情 */
|
||||
private String subDeptInfos;
|
||||
|
||||
/** 合同承包内容 */
|
||||
@Excel(name = "合同承包内容")
|
||||
private String contractInfos;
|
||||
|
@ -94,6 +101,13 @@ public class ProProjectInfoSubdepts extends BaseEntity
|
|||
@Excel(name = "删除标识")
|
||||
private Long isDel;
|
||||
|
||||
/** 委托人正面照片 */
|
||||
private String leaderCardImgPos;
|
||||
/** 委托人反面照片 */
|
||||
private String leaderCardImgInv;
|
||||
/** 委托人半身照片 */
|
||||
private String leaderUserPicture;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
@ -121,15 +135,7 @@ public class ProProjectInfoSubdepts extends BaseEntity
|
|||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setSubDeptId(Long subDeptId)
|
||||
{
|
||||
this.subDeptId = subDeptId;
|
||||
}
|
||||
|
||||
public Long getSubDeptId()
|
||||
{
|
||||
return subDeptId;
|
||||
}
|
||||
public void setSubDeptType(String subDeptType)
|
||||
{
|
||||
this.subDeptType = subDeptType;
|
||||
|
@ -194,6 +200,30 @@ public class ProProjectInfoSubdepts extends BaseEntity
|
|||
return subDeptLeaderPhone;
|
||||
}
|
||||
|
||||
public String getSubDeptLeaderPowerPath() {
|
||||
return subDeptLeaderPowerPath;
|
||||
}
|
||||
|
||||
public void setSubDeptLeaderPowerPath(String subDeptLeaderPowerPath) {
|
||||
this.subDeptLeaderPowerPath = subDeptLeaderPowerPath;
|
||||
}
|
||||
|
||||
public String getBusinessLicensePath() {
|
||||
return businessLicensePath;
|
||||
}
|
||||
|
||||
public void setBusinessLicensePath(String businessLicensePath) {
|
||||
this.businessLicensePath = businessLicensePath;
|
||||
}
|
||||
|
||||
public String getSubDeptInfos() {
|
||||
return subDeptInfos;
|
||||
}
|
||||
|
||||
public void setSubDeptInfos(String subDeptInfos) {
|
||||
this.subDeptInfos = subDeptInfos;
|
||||
}
|
||||
|
||||
public String getContractInfos() {
|
||||
return contractInfos;
|
||||
}
|
||||
|
@ -263,13 +293,36 @@ public class ProProjectInfoSubdepts extends BaseEntity
|
|||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getLeaderCardImgPos() {
|
||||
return leaderCardImgPos;
|
||||
}
|
||||
|
||||
public void setLeaderCardImgPos(String leaderCardImgPos) {
|
||||
this.leaderCardImgPos = leaderCardImgPos;
|
||||
}
|
||||
|
||||
public String getLeaderCardImgInv() {
|
||||
return leaderCardImgInv;
|
||||
}
|
||||
|
||||
public void setLeaderCardImgInv(String leaderCardImgInv) {
|
||||
this.leaderCardImgInv = leaderCardImgInv;
|
||||
}
|
||||
|
||||
public String getLeaderUserPicture() {
|
||||
return leaderUserPicture;
|
||||
}
|
||||
|
||||
public void setLeaderUserPicture(String leaderUserPicture) {
|
||||
this.leaderUserPicture = leaderUserPicture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("comId", getComId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("subDeptId", getSubDeptId())
|
||||
.append("subDeptType", getSubDeptType())
|
||||
.append("subDeptName", getSubDeptName())
|
||||
.append("subDeptCode", getSubDeptCode())
|
||||
|
@ -277,6 +330,9 @@ public class ProProjectInfoSubdepts extends BaseEntity
|
|||
.append("subDeptLeaderName", getSubDeptLeaderName())
|
||||
.append("subDeptLeaderCode", getSubDeptLeaderCode())
|
||||
.append("subDeptLeaderPhone", getSubDeptLeaderPhone())
|
||||
.append("subDeptLeaderPowerPath", getSubDeptLeaderPowerPath())
|
||||
.append("businessLicensePath", getBusinessLicensePath())
|
||||
.append("subDeptInfos", getSubDeptInfos())
|
||||
.append("contractInfos", getContractInfos())
|
||||
.append("useDates", getUseDates())
|
||||
.append("useStatus", getUseStatus())
|
||||
|
|
|
@ -58,4 +58,12 @@ public interface ProProjectInfoSubdeptsUsersMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteProProjectInfoSubdeptsUsersByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询用户是否存在
|
||||
*
|
||||
* @param phonenumber 注册电话
|
||||
* @return 结果
|
||||
*/
|
||||
public int findUserByUserPhone(String phonenumber);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="projectType" column="project_type" />
|
||||
<result property="projectLevel" column="project_level" />
|
||||
<result property="projectRegional" column="project_regional" />
|
||||
<result property="projectPackage" column="project_package" />
|
||||
<result property="projectAddress" column="project_address" />
|
||||
<result property="projectNature" column="project_nature" />
|
||||
<result property="licenceNumber" column="licence_number" />
|
||||
|
@ -71,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectProProjectInfoVo">
|
||||
select pi.id, pi.com_id, sd.dept_name as com_name, pi.dis_dept_id, pi.project_name, pi.project_code, pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_address, pi.project_nature, pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment, pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time, pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status, pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark
|
||||
select pi.id, pi.com_id, sd.dept_name as com_name, pi.dis_dept_id, pi.project_name, pi.project_code, pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_package, pi.project_address, pi.project_nature, pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment, pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time, pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status, pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark
|
||||
from pro_project_info pi
|
||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||
</sql>
|
||||
|
@ -100,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectProProjectInfoById" parameterType="Long" resultMap="ProProjectInfoResult">
|
||||
select pi.id, pi.com_id, sd.dept_name as com_name, pi.dis_dept_id, pi.project_name,
|
||||
pi.project_code, pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_address, pi.project_nature,
|
||||
pi.project_code, pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_package, pi.project_address, pi.project_nature,
|
||||
pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment,
|
||||
pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time,
|
||||
pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status,
|
||||
|
@ -126,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="projectType != null">project_type,</if>
|
||||
<if test="projectLevel != null">project_level,</if>
|
||||
<if test="projectRegional != null">project_regional,</if>
|
||||
<if test="projectPackage != null">project_package,</if>
|
||||
<if test="projectAddress != null">project_address,</if>
|
||||
<if test="projectNature != null">project_nature,</if>
|
||||
<if test="licenceNumber != null">licence_number,</if>
|
||||
|
@ -166,6 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="projectType != null">#{projectType},</if>
|
||||
<if test="projectLevel != null">#{projectLevel},</if>
|
||||
<if test="projectRegional != null">#{projectRegional},</if>
|
||||
<if test="projectPackage != null">#{projectPackage},</if>
|
||||
<if test="projectAddress != null">#{projectAddress},</if>
|
||||
<if test="projectNature != null">#{projectNature},</if>
|
||||
<if test="licenceNumber != null">#{licenceNumber},</if>
|
||||
|
@ -209,6 +212,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="projectType != null">project_type = #{projectType},</if>
|
||||
<if test="projectLevel != null">project_level = #{projectLevel},</if>
|
||||
<if test="projectRegional != null">project_regional = #{projectRegional},</if>
|
||||
<if test="projectPackage != null">project_package = #{projectPackage},</if>
|
||||
<if test="projectAddress != null">project_address = #{projectAddress},</if>
|
||||
<if test="projectNature != null">project_nature = #{projectNature},</if>
|
||||
<if test="licenceNumber != null">licence_number = #{licenceNumber},</if>
|
||||
|
@ -258,7 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="deptShortName != null and deptName != ''">dept_short_name,</if>
|
||||
<if test="deptShortName != null and deptShortName != ''">dept_short_name,</if>
|
||||
<if test="deptCode != null and deptName != ''">dept_code,</if>
|
||||
<if test="deptType != null and deptName != ''">dept_type,</if>
|
||||
<if test="deptInfos != null and deptName != ''">dept_infos,</if>
|
||||
|
@ -274,6 +278,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deptShortName != null and deptShortName != ''">#{deptShortName},</if>
|
||||
<if test="deptCode != null and deptCode != ''">#{deptCode},</if>
|
||||
<if test="deptType != null and deptType != ''">#{deptType},</if>
|
||||
<if test="deptInfos != null and deptInfos != ''">#{deptInfos},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="leader != null and leader != ''">#{leader},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
|
@ -291,6 +296,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deptShortName != null and deptShortName != ''">dept_short_name = #{deptShortName},</if>
|
||||
<if test="deptCode != null and deptCode != ''">dept_code = #{deptCode},</if>
|
||||
<if test="deptType != null and deptType != ''">dept_type = #{deptType},</if>
|
||||
<if test="deptInfos != null and deptInfos != ''">dept_infos = #{deptInfos},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
|
|
|
@ -10,7 +10,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="comName" column="com_name" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="subDeptId" column="sub_dept_id" />
|
||||
<result property="subDeptType" column="sub_dept_type" />
|
||||
<result property="subDeptName" column="sub_dept_name" />
|
||||
<result property="subDeptCode" column="sub_dept_code" />
|
||||
|
@ -18,6 +17,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="subDeptLeaderName" column="sub_dept_leader_name" />
|
||||
<result property="subDeptLeaderCode" column="sub_dept_leader_code" />
|
||||
<result property="subDeptLeaderPhone" column="sub_dept_leader_phone" />
|
||||
<result property="subDeptLeaderPowerPath" column="sub_dept_leader_power_path" />
|
||||
<result property="businessLicensePath" column="business_license_path" />
|
||||
<result property="subDeptInfos" column="sub_dept_infos" />
|
||||
<result property="contractInfos" column="contract_infos" />
|
||||
<result property="useDates" column="use_dates" />
|
||||
<result property="useStatus" column="use_status" />
|
||||
|
@ -32,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectProProjectInfoSubdeptsVo">
|
||||
select ps.id, ps.com_id, sd.dept_name, ps.project_id, pi.project_name, ps.sub_dept_id, ps.sub_dept_type, ps.sub_dept_name, ps.sub_dept_code, ps.sub_dept_leader_id, ps.sub_dept_leader_name, ps.sub_dept_leader_code, ps.sub_dept_leader_phone, ps.contract_infos, ps.use_dates, ps.use_status, ps.approve_status, ps.qr_code, ps.is_del, ps.create_by, ps.create_time, ps.update_by, ps.update_time, ps.remark from pro_project_info_subdepts ps
|
||||
select ps.id, ps.com_id, sd.dept_name as com_name, ps.project_id, pi.project_name, ps.sub_dept_type, ps.sub_dept_name, ps.sub_dept_code, ps.sub_dept_leader_id, ps.sub_dept_leader_name, ps.sub_dept_leader_code, ps.sub_dept_leader_phone, ps.sub_dept_leader_power_path, ps.business_license_path, ps.sub_dept_infos, ps.contract_infos, ps.use_dates, ps.use_status, ps.approve_status, ps.qr_code, ps.is_del, ps.create_by, ps.create_time, ps.update_by, ps.update_time, ps.remark from pro_project_info_subdepts ps
|
||||
left join pro_project_info pi on pi.id = ps.project_id
|
||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||
</sql>
|
||||
|
@ -42,8 +44,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<where>
|
||||
<if test="comId != null "> and ps.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and ps.project_id = #{projectId}</if>
|
||||
<if test="activeComId != null "> and ps.com_id = #{activeComId}</if>
|
||||
<if test="activeProjectId != null "> and ps.project_id = #{activeProjectId}</if>
|
||||
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="subDeptId != null "> and ps.sub_dept_id = #{subDeptId}</if>
|
||||
<if test="subDeptType != null and subDeptType != ''"> and ps.sub_dept_type = #{subDeptType}</if>
|
||||
<if test="subDeptName != null and subDeptName != ''"> and ps.sub_dept_name like concat('%', #{subDeptName}, '%')</if>
|
||||
<if test="subDeptCode != null and subDeptCode != ''"> and ps.sub_dept_code = #{subDeptCode}</if>
|
||||
|
@ -68,7 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">com_id,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="subDeptId != null">sub_dept_id,</if>
|
||||
<if test="subDeptType != null">sub_dept_type,</if>
|
||||
<if test="subDeptName != null">sub_dept_name,</if>
|
||||
<if test="subDeptCode != null">sub_dept_code,</if>
|
||||
|
@ -76,6 +78,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="subDeptLeaderName != null">sub_dept_leader_name,</if>
|
||||
<if test="subDeptLeaderCode != null">sub_dept_leader_code,</if>
|
||||
<if test="subDeptLeaderPhone != null">sub_dept_leader_phone,</if>
|
||||
<if test="subDeptLeaderPowerPath != null">sub_dept_leader_power_path,</if>
|
||||
<if test="businessLicensePath != null">business_license_path,</if>
|
||||
<if test="subDeptInfos != null">sub_dept_infos,</if>
|
||||
<if test="contractInfos != null">contract_infos,</if>
|
||||
<if test="useDates != null">use_dates,</if>
|
||||
<if test="useStatus != null">use_status,</if>
|
||||
|
@ -91,7 +96,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">#{comId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="subDeptId != null">#{subDeptId},</if>
|
||||
<if test="subDeptType != null">#{subDeptType},</if>
|
||||
<if test="subDeptName != null">#{subDeptName},</if>
|
||||
<if test="subDeptCode != null">#{subDeptCode},</if>
|
||||
|
@ -99,6 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="subDeptLeaderName != null">#{subDeptLeaderName},</if>
|
||||
<if test="subDeptLeaderCode != null">#{subDeptLeaderCode},</if>
|
||||
<if test="subDeptLeaderPhone != null">#{subDeptLeaderPhone},</if>
|
||||
<if test="subDeptLeaderPowerPath != null">#{subDeptLeaderPowerPath},</if>
|
||||
<if test="businessLicensePath != null">#{businessLicensePath},</if>
|
||||
<if test="subDeptInfos != null">#{subDeptInfos},</if>
|
||||
<if test="contractInfos != null">#{contractInfos},</if>
|
||||
<if test="useDates != null">#{useDates},</if>
|
||||
<if test="useStatus != null">#{useStatus},</if>
|
||||
|
@ -118,7 +125,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="comId != null">com_id = #{comId},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="subDeptId != null">sub_dept_id = #{subDeptId},</if>
|
||||
<if test="subDeptType != null">sub_dept_type = #{subDeptType},</if>
|
||||
<if test="subDeptName != null">sub_dept_name = #{subDeptName},</if>
|
||||
<if test="subDeptCode != null">sub_dept_code = #{subDeptCode},</if>
|
||||
|
@ -126,6 +132,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="subDeptLeaderName != null">sub_dept_leader_name = #{subDeptLeaderName},</if>
|
||||
<if test="subDeptLeaderCode != null">sub_dept_leader_code = #{subDeptLeaderCode},</if>
|
||||
<if test="subDeptLeaderPhone != null">sub_dept_leader_phone = #{subDeptLeaderPhone},</if>
|
||||
<if test="subDeptLeaderPowerPath != null">sub_dept_leader_power_path = #{subDeptLeaderPowerPath},</if>
|
||||
<if test="businessLicensePath != null">business_license_path = #{businessLicensePath},</if>
|
||||
<if test="subDeptInfos != null">sub_dept_infos = #{subDeptInfos},</if>
|
||||
<if test="contractInfos != null">contract_infos = #{contractInfos},</if>
|
||||
<if test="useDates != null">use_dates = #{useDates},</if>
|
||||
<if test="useStatus != null">use_status = #{useStatus},</if>
|
||||
|
|
|
@ -162,4 +162,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="findUserByUserPhone" parameterType="String" resultType="int">
|
||||
select count(1) from sys_user where phonenumber=#{phonenumber}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -45,4 +45,26 @@ public class SysFileController
|
|||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传请求
|
||||
*/
|
||||
@PostMapping("uploadPath")
|
||||
public R<SysFile> uploadPath(MultipartFile file, String path)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传并返回访问地址
|
||||
String url = sysFileService.uploadFile(file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(url));
|
||||
sysFile.setUrl(url);
|
||||
return R.ok(sysFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("上传文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,4 +39,9 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
|
|||
FileTypeUtils.getExtension(file), null);
|
||||
return domain + "/" + storePath.getFullPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadFilePath(MultipartFile file, String path) throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,4 +17,13 @@ public interface ISysFileService
|
|||
* @throws Exception
|
||||
*/
|
||||
public String uploadFile(MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public String uploadFilePath(MultipartFile file,String path) throws Exception;
|
||||
}
|
||||
|
|
|
@ -47,4 +47,18 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
|||
String url = domain + localFilePrefix + name;
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地文件上传接口 && 自定义目录
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String uploadFilePath(MultipartFile file, String path) throws Exception {
|
||||
String name = FileUploadUtils.upload(localFilePath+"/"+path, file);
|
||||
String url = domain + localFilePrefix + name;
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,4 +42,9 @@ public class MinioSysFileServiceImpl implements ISysFileService
|
|||
client.putObject(args);
|
||||
return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadFilePath(MultipartFile file, String path) throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,6 +83,12 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-mp</artifactId>
|
||||
<version>2.7.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- YanZhu Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.yanzhu</groupId>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.yanzhu.manage.config;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 微信配置
|
||||
*/
|
||||
@Configuration
|
||||
public class WeChatConfig {
|
||||
|
||||
@Autowired
|
||||
private WeChatProperties weChatProperties;
|
||||
|
||||
@Bean
|
||||
public WxMpService wxMpService() {
|
||||
WxMpInMemoryConfigStorage config = new WxMpInMemoryConfigStorage();
|
||||
config.setAppId(weChatProperties.getWxAppId());
|
||||
config.setSecret(weChatProperties.getWxAppSecret());
|
||||
|
||||
WxMpServiceImpl wxMpService = new WxMpServiceImpl();
|
||||
wxMpService.setWxMpConfigStorage(config);
|
||||
|
||||
return wxMpService;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.yanzhu.manage.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 微信配置文件
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "wechat")
|
||||
public class WeChatProperties {
|
||||
|
||||
/**
|
||||
* 公众号
|
||||
*/
|
||||
private String mpAppId;
|
||||
private String mpAppSecret;
|
||||
|
||||
/**
|
||||
* 小程序
|
||||
*/
|
||||
private String wxAppId;
|
||||
private String wxAppSecret;
|
||||
}
|
|
@ -58,4 +58,9 @@ public interface IProProjectInfoService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteProProjectInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 加载地址信息到缓存
|
||||
*/
|
||||
public void loadingProjectsCache();
|
||||
}
|
||||
|
|
|
@ -1,26 +1,32 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.yanzhu.common.core.constant.CacheConstants;
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.domain.R;
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.domain.ProDept;
|
||||
import com.yanzhu.manage.domain.ProProjectInfo;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoDepts;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSetting;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoDeptsMapper;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoMapper;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoSettingMapper;
|
||||
import com.yanzhu.manage.service.IProProjectInfoService;
|
||||
import com.yanzhu.system.api.RemoteDeptService;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
import com.yanzhu.system.api.domain.SysDept;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoMapper;
|
||||
import com.yanzhu.manage.domain.ProProjectInfo;
|
||||
import com.yanzhu.manage.service.IProProjectInfoService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目信息Service业务层处理
|
||||
|
@ -31,6 +37,9 @@ import com.yanzhu.manage.service.IProProjectInfoService;
|
|||
@Service
|
||||
public class ProProjectInfoServiceImpl implements IProProjectInfoService
|
||||
{
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private ProProjectInfoDeptsMapper deptsMapper;
|
||||
|
||||
|
@ -43,6 +52,28 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
|
|||
@Autowired
|
||||
private RemoteDeptService remoteDeptService;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
loadingProjectsCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载地址信息到缓存
|
||||
*/
|
||||
@Override
|
||||
public void loadingProjectsCache(){
|
||||
List<ProProjectInfo> list = proProjectInfoMapper.selectProProjectInfoList(new ProProjectInfo());
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
for(ProProjectInfo info:list){
|
||||
redisService.setCacheObject(CacheConstants.PRO_PROJECT+info.getId(),info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目信息
|
||||
*
|
||||
|
@ -99,8 +130,11 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
|
|||
if(res>0){
|
||||
proProjectInfo.setId(proDept.getDeptId());
|
||||
proProjectInfo.setComId(sysDept.getComId());
|
||||
proProjectInfo.setProjectPackage(projectPackage(proProjectInfo.getProjectName(),proDept.getDeptId()));
|
||||
proProjectInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return proProjectInfoMapper.insertProProjectInfo(proProjectInfo);
|
||||
res = proProjectInfoMapper.insertProProjectInfo(proProjectInfo);
|
||||
loadingProjectsCache();
|
||||
return res;
|
||||
}else{
|
||||
throw new ServiceException("项目信息保存失败!!!");
|
||||
}
|
||||
|
@ -150,6 +184,7 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
|
|||
proDept.setPhone(proProjectInfo.getProjectPersonPhone());
|
||||
proProjectInfoMapper.updateDept(proDept);
|
||||
}
|
||||
loadingProjectsCache();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -176,4 +211,31 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
|
|||
{
|
||||
return proProjectInfoMapper.deleteProProjectInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户名称
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private String projectPackage(String name,Long deptId){
|
||||
// 设置不带声调的输出选项
|
||||
HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
|
||||
format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
|
||||
|
||||
StringBuilder output = new StringBuilder();
|
||||
for (char c : name.toCharArray()) {
|
||||
try {
|
||||
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c, format);
|
||||
if (pinyinArray != null && pinyinArray.length > 0) {
|
||||
output.append(pinyinArray[0]);
|
||||
} else {
|
||||
output.append(c);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
output.append(c);
|
||||
}
|
||||
}
|
||||
output.append("_"+deptId);
|
||||
return output.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,26 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.common.core.constant.CacheConstants;
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.enums.CardTypeEnums;
|
||||
import com.yanzhu.common.core.enums.UserTypeEnums;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.domain.ProProjectInfo;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdepts;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsMapper;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
|
||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsService;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsMapper;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdepts;
|
||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 分包单位Service业务层处理
|
||||
|
@ -17,9 +31,18 @@ import com.yanzhu.manage.service.IProProjectInfoSubdeptsService;
|
|||
@Service
|
||||
public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdeptsService
|
||||
{
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Autowired
|
||||
private ProProjectInfoSubdeptsMapper proProjectInfoSubdeptsMapper;
|
||||
|
||||
@Autowired
|
||||
private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper;
|
||||
|
||||
/**
|
||||
* 查询分包单位
|
||||
*
|
||||
|
@ -41,6 +64,8 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
|
|||
@Override
|
||||
public List<ProProjectInfoSubdepts> selectProProjectInfoSubdeptsList(ProProjectInfoSubdepts proProjectInfoSubdepts)
|
||||
{
|
||||
proProjectInfoSubdepts.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
|
||||
proProjectInfoSubdepts.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
|
||||
return proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsList(proProjectInfoSubdepts);
|
||||
}
|
||||
|
||||
|
@ -51,8 +76,40 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertProProjectInfoSubdepts(ProProjectInfoSubdepts proProjectInfoSubdepts)
|
||||
{
|
||||
ProProjectInfo info = redisService.getCacheObject(CacheConstants.PRO_PROJECT+proProjectInfoSubdepts.getProjectId());
|
||||
proProjectInfoSubdepts.setComId(info.getComId());
|
||||
if(Objects.equals(proProjectInfoSubdepts.getSubDeptType(),"4") || Objects.equals(proProjectInfoSubdepts.getSubDeptType(),"4")){
|
||||
// TODO:生成二维码
|
||||
|
||||
// 单位委托人信息
|
||||
if(StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderName()) && StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderCode()) && StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderPhone())){
|
||||
// 判断用户是否存在
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(proProjectInfoSubdepts.getSubDeptLeaderPhone());
|
||||
sysUser.setNickName(proProjectInfoSubdepts.getSubDeptLeaderName());
|
||||
sysUser.setUserType(UserTypeEnums.FBDL.getCode());
|
||||
sysUser.setCardType(CardTypeEnums.SFZ.getCode());
|
||||
sysUser.setCardCode(proProjectInfoSubdepts.getSubDeptLeaderCode());
|
||||
sysUser.setUserPicture(proProjectInfoSubdepts.getLeaderUserPicture());
|
||||
sysUser.setCardImgPos(proProjectInfoSubdepts.getLeaderCardImgPos());
|
||||
sysUser.setCardImgInv(proProjectInfoSubdepts.getLeaderCardImgInv());
|
||||
sysUser.setSex(StringUtils.judgeGender(proProjectInfoSubdepts.getSubDeptLeaderCode()));
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
sysUser.setCreateTime(DateUtils.getNowDate());
|
||||
sysUser.setRemark(proProjectInfoSubdepts.getSubDeptName());
|
||||
try {
|
||||
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||
}catch (Exception e){
|
||||
// 已注册账号!!忽略异常...
|
||||
}
|
||||
|
||||
// TODO:实名制接入
|
||||
}
|
||||
}
|
||||
proProjectInfoSubdepts.setCreateBy(SecurityUtils.getUsername());
|
||||
proProjectInfoSubdepts.setCreateTime(DateUtils.getNowDate());
|
||||
return proProjectInfoSubdeptsMapper.insertProProjectInfoSubdepts(proProjectInfoSubdepts);
|
||||
}
|
||||
|
@ -66,6 +123,37 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
|
|||
@Override
|
||||
public int updateProProjectInfoSubdepts(ProProjectInfoSubdepts proProjectInfoSubdepts)
|
||||
{
|
||||
if(Objects.equals(proProjectInfoSubdepts.getSubDeptType(),"4") || Objects.equals(proProjectInfoSubdepts.getSubDeptType(),"4")){
|
||||
if(StringUtils.isEmpty(proProjectInfoSubdepts.getQrCode())){
|
||||
// TODO:生成二维码
|
||||
|
||||
// 单位委托人信息
|
||||
if(StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderName()) && StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderCode()) && StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderPhone())){
|
||||
// 判断用户是否存在
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(proProjectInfoSubdepts.getSubDeptLeaderPhone());
|
||||
sysUser.setNickName(proProjectInfoSubdepts.getSubDeptLeaderName());
|
||||
sysUser.setUserType(UserTypeEnums.FBDL.getCode());
|
||||
sysUser.setCardType(CardTypeEnums.SFZ.getCode());
|
||||
sysUser.setCardCode(proProjectInfoSubdepts.getSubDeptLeaderCode());
|
||||
sysUser.setUserPicture(proProjectInfoSubdepts.getLeaderUserPicture());
|
||||
sysUser.setCardImgPos(proProjectInfoSubdepts.getLeaderCardImgPos());
|
||||
sysUser.setCardImgInv(proProjectInfoSubdepts.getLeaderCardImgInv());
|
||||
sysUser.setSex(StringUtils.judgeGender(proProjectInfoSubdepts.getSubDeptLeaderCode()));
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
sysUser.setCreateTime(DateUtils.getNowDate());
|
||||
sysUser.setRemark(proProjectInfoSubdepts.getSubDeptName());
|
||||
try {
|
||||
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||
}catch (Exception e){
|
||||
// 已注册账号!!忽略异常...
|
||||
}
|
||||
|
||||
// TODO:实名制接入
|
||||
}
|
||||
}
|
||||
}
|
||||
proProjectInfoSubdepts.setUpdateBy(SecurityUtils.getUsername());
|
||||
proProjectInfoSubdepts.setUpdateTime(DateUtils.getNowDate());
|
||||
return proProjectInfoSubdeptsMapper.updateProProjectInfoSubdepts(proProjectInfoSubdepts);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
package com.yanzhu.manage.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
public class WxQrCodeUtils {
|
||||
|
||||
/**
|
||||
* 生成微信小程序二维码
|
||||
*
|
||||
* @param filePath 本地生成二维码路径
|
||||
* @param page 当前小程序相对页面 必须是已经发布的小程序存在的页面(否则报错),例如 pages/index/index, 根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面
|
||||
* @param scene 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
|
||||
* @param accessToken 接口调用凭证
|
||||
*/
|
||||
public static void generateQrCode(String filePath, String page, String scene, String accessToken) {
|
||||
try {
|
||||
//调用微信接口生成二维码
|
||||
URL url = new URL("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken);
|
||||
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
|
||||
httpURLConnection.setRequestMethod("POST");// 提交模式
|
||||
// conn.setConnectTimeout(10000);//连接超时 单位毫秒
|
||||
// conn.setReadTimeout(2000);//读取超时 单位毫秒
|
||||
// 发送POST请求必须设置如下两行
|
||||
httpURLConnection.setDoOutput(true);
|
||||
httpURLConnection.setDoInput(true);
|
||||
// 获取URLConnection对象对应的输出流
|
||||
PrintWriter printWriter = new PrintWriter(httpURLConnection.getOutputStream());
|
||||
// 发送请求参数
|
||||
JSONObject paramJson = new JSONObject();
|
||||
//这就是你二维码里携带的参数 String型 名称不可变
|
||||
paramJson.put("scene", scene);
|
||||
//注意该接口传入的是page而不是path
|
||||
paramJson.put("page", page);
|
||||
//这是设置扫描二维码后跳转的页面
|
||||
paramJson.put("width", 200);
|
||||
paramJson.put("is_hyaline", true);
|
||||
paramJson.put("auto_color", true);
|
||||
printWriter.write(paramJson.toString());
|
||||
// flush输出流的缓冲
|
||||
printWriter.flush();
|
||||
|
||||
//开始获取数据
|
||||
BufferedInputStream bis = new BufferedInputStream(httpURLConnection.getInputStream());
|
||||
OutputStream os = new FileOutputStream(new File(filePath));
|
||||
int len;
|
||||
byte[] arr = new byte[1024];
|
||||
while ((len = bis.read(arr)) != -1) {
|
||||
os.write(arr, 0, len);
|
||||
os.flush();
|
||||
}
|
||||
os.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("打开地址查看生成的二维码:" + filePath);
|
||||
}
|
||||
}
|
|
@ -85,12 +85,6 @@
|
|||
<artifactId>yanzhu-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Belerweb Pinyin4j -->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -3,12 +3,14 @@ package com.yanzhu.system.controller;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.yanzhu.common.core.constant.Constants;
|
||||
import com.yanzhu.common.core.enums.UserTypeEnums;
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.system.domain.vo.TreeSelect;
|
||||
|
@ -54,8 +56,7 @@ import com.yanzhu.system.service.ISysUserService;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class SysUserController extends BaseController
|
||||
{
|
||||
public class SysUserController extends BaseController {
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
|
@ -82,8 +83,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
public TableDataInfo list(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
|
@ -92,8 +92,7 @@ public class SysUserController extends BaseController
|
|||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysUser user) {
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.exportExcel(response, list, "用户数据");
|
||||
|
@ -102,8 +101,7 @@ public class SysUserController extends BaseController
|
|||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@RequiresPermissions("system:user:import")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||
String operName = SecurityUtils.getUsername();
|
||||
|
@ -112,8 +110,7 @@ public class SysUserController extends BaseController
|
|||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException
|
||||
{
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.importTemplateExcel(response, "用户数据");
|
||||
}
|
||||
|
@ -123,15 +120,12 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@InnerAuth
|
||||
@GetMapping("/info/{username}")
|
||||
public R<LoginUser> info(@PathVariable("username") String username)
|
||||
{
|
||||
public R<LoginUser> info(@PathVariable("username") String username) {
|
||||
SysUser sysUser = userService.selectUserByUserName(username);
|
||||
if (StringUtils.isNull(sysUser))
|
||||
{
|
||||
if (StringUtils.isNull(sysUser)) {
|
||||
return R.fail("用户名或密码错误");
|
||||
}
|
||||
if (StringUtils.isEmpty(sysUser.getRoles()))
|
||||
{
|
||||
if (StringUtils.isEmpty(sysUser.getRoles())) {
|
||||
return R.fail("用户未查询到分配角色,请联系管理员!!!");
|
||||
}
|
||||
// 重写登录方法
|
||||
|
@ -144,8 +138,7 @@ public class SysUserController extends BaseController
|
|||
} else {
|
||||
// 查询用户绑定项目列表
|
||||
List<Map<String, Object>> list = userService.selectProjectsByUserId(sysUser.getUserId());
|
||||
if (StringUtils.isEmpty(list))
|
||||
{
|
||||
if (StringUtils.isEmpty(list)) {
|
||||
return R.fail("用户角色配置异常,请联系管理员!!!");
|
||||
}
|
||||
// 以项目人员身份登录
|
||||
|
@ -171,8 +164,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@InnerAuth
|
||||
@GetMapping("/infoAndDept/{username}/{deptId}")
|
||||
public R<LoginUser> infoAndDept(@PathVariable("username") String username,@PathVariable("deptId") Long deptId)
|
||||
{
|
||||
public R<LoginUser> infoAndDept(@PathVariable("username") String username, @PathVariable("deptId") Long deptId) {
|
||||
// 以项目人员身份登录
|
||||
SysUser sysUser = userService.selectUserByUserName(username, deptId);
|
||||
List<Map<String, Object>> list = userService.selectProjectsByUserId(sysUser.getUserId());
|
||||
|
@ -197,15 +189,14 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@InnerAuth
|
||||
@PostMapping("/register")
|
||||
public R<Boolean> register(@RequestBody SysUser sysUser)
|
||||
{
|
||||
public R<Boolean> register(@RequestBody SysUser sysUser) {
|
||||
String username = sysUser.getUserName();
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
||||
{
|
||||
if (Objects.isNull(sysUser.getUserType()) || Objects.equals(UserTypeEnums.ZSRY.getCode(), sysUser.getUserType())) {
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||
return R.fail("当前系统没有开启注册功能!");
|
||||
}
|
||||
if (!userService.checkUserNameUnique(sysUser))
|
||||
{
|
||||
}
|
||||
if (!userService.checkUserNameUnique(sysUser)) {
|
||||
return R.fail("保存用户'" + username + "'失败,注册账号已存在");
|
||||
}
|
||||
return R.ok(userService.registerUser(sysUser));
|
||||
|
@ -216,8 +207,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@InnerAuth
|
||||
@GetMapping("/sysUser/{userId}")
|
||||
public R<SysUser> getSysUserInfo(@PathVariable("userId") Long userId)
|
||||
{
|
||||
public R<SysUser> getSysUserInfo(@PathVariable("userId") Long userId) {
|
||||
SysUser sysUser = userService.selectUserByUserId(userId);
|
||||
return R.ok(sysUser);
|
||||
}
|
||||
|
@ -228,8 +218,7 @@ public class SysUserController extends BaseController
|
|||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo()
|
||||
{
|
||||
public AjaxResult getInfo() {
|
||||
SysUser cache = SecurityUtils.getLoginUser().getSysUser();
|
||||
SysUser user;
|
||||
if (SecurityUtils.isAdmin(cache.getUserId())) {
|
||||
|
@ -260,15 +249,13 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:user:query")
|
||||
@GetMapping(value = {"/", "/{userId}"})
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
||||
userService.checkUserDataScope(userId);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
List<SysRole> roles = roleService.selectRoleAll();
|
||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
ajax.put("posts", postService.selectPostAll());
|
||||
if (StringUtils.isNotNull(userId))
|
||||
{
|
||||
if (StringUtils.isNotNull(userId)) {
|
||||
SysUser sysUser;
|
||||
if (SysUser.isAdmin(userId)) {
|
||||
sysUser = userService.selectUserById(userId);
|
||||
|
@ -289,18 +276,12 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:add")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysUser user)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user))
|
||||
{
|
||||
public AjaxResult add(@Validated @RequestBody SysUser user) {
|
||||
if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setCreateBy(SecurityUtils.getUsername());
|
||||
|
@ -314,20 +295,14 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
||||
{
|
||||
public AjaxResult edit(@Validated @RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -340,10 +315,8 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:remove")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] userIds)
|
||||
{
|
||||
if (ArrayUtils.contains(userIds, SecurityUtils.getUserId()))
|
||||
{
|
||||
public AjaxResult remove(@PathVariable Long[] userIds) {
|
||||
if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) {
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
|
@ -355,8 +328,7 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user)
|
||||
{
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
|
@ -370,8 +342,7 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysUser user)
|
||||
{
|
||||
public AjaxResult changeStatus(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -383,8 +354,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:user:query")
|
||||
@GetMapping("/authRole/{userId}")
|
||||
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
||||
{
|
||||
public AjaxResult authRole(@PathVariable("userId") Long userId) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
List<SysRole> roles = roleService.findDeptRoleListByComId(user.getComId());
|
||||
|
@ -399,8 +369,7 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authRole")
|
||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
||||
{
|
||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
|
||||
userService.checkUserDataScope(userId);
|
||||
userService.insertUserAuth(userId, roleIds);
|
||||
return success();
|
||||
|
@ -411,8 +380,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/deptTree")
|
||||
public AjaxResult deptTree(SysDept dept)
|
||||
{
|
||||
public AjaxResult deptTree(SysDept dept) {
|
||||
String key = "user.deptTree_" + SecurityUtils.getUserId();
|
||||
Object cache = redisService.getCacheObject(key);
|
||||
if (cache != null) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.yanzhu.system.domain.SysUserRole;
|
|||
import com.yanzhu.system.mapper.*;
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -363,8 +364,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
*/
|
||||
private String userNameAndCout(String name){
|
||||
// 设置不带声调的输出选项
|
||||
HanyuPinyinOutputFormat format = new net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat();
|
||||
format.setToneType(net.sourceforge.pinyin4j.format.HanyuPinyinToneType.WITHOUT_TONE);
|
||||
HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
|
||||
format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
|
||||
|
||||
StringBuilder output = new StringBuilder();
|
||||
for (char c : name.toCharArray()) {
|
||||
|
|
|
@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="deptShortName != null and deptName != ''">dept_short_name,</if>
|
||||
<if test="deptShortName != null and deptShortName != ''">dept_short_name,</if>
|
||||
<if test="deptCode != null and deptName != ''">dept_code,</if>
|
||||
<if test="deptType != null and deptName != ''">dept_type,</if>
|
||||
<if test="deptInfos != null and deptName != ''">dept_infos,</if>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<el-button type="primary" plain :icon="OfficeBuilding" @click="showProList">{{userStore.currentProId?userStore.currentProName:'所有项目'}}</el-button>
|
||||
|
||||
<!--选择项目-->
|
||||
<el-dialog v-model="dialogVisible" title="选择切换项目" width="800">
|
||||
<el-dialog v-model="dialogVisible" title="选择切换项目" width="800" custom-class="CurrentProjectDlg">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
|
@ -120,14 +120,16 @@ function changeDefault(proId) {
|
|||
if(isAdmin.value){
|
||||
switchProject(proId).then(res =>{
|
||||
if(res.code==200){
|
||||
window.location.reload();
|
||||
proxy.$modal.loading("正在切换项目信息,请稍后...");
|
||||
setTimeout("window.location.reload()", 500);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
changeDefaultProject(proId).then(response =>{
|
||||
switchProject(proId).then(res =>{
|
||||
if(res.code==200){
|
||||
window.location.reload();
|
||||
proxy.$modal.loading("正在切换项目信息,请稍后...");
|
||||
setTimeout("window.location.reload()", 500);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -138,7 +140,8 @@ function changeDefault(proId) {
|
|||
function circleClose() {
|
||||
cancelProject().then(res =>{
|
||||
if(res.code==200){
|
||||
window.location.reload();
|
||||
proxy.$modal.loading("正在查询所有项目,请稍后...");
|
||||
setTimeout("window.location.reload()", 500);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -161,7 +164,8 @@ function initPage() {
|
|||
|
||||
initPage();
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
<style lang="scss">
|
||||
.CurrentProjectDlg{
|
||||
.el-dialog__body{
|
||||
margin-top: -30px;
|
||||
padding-bottom: 50px;
|
||||
|
@ -172,4 +176,5 @@ initPage();
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -24,15 +24,15 @@ const route = useRoute();
|
|||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const sizeOptions = ref([
|
||||
{ label: "较大", value: "large" },
|
||||
{ label: "默认", value: "default" },
|
||||
{ label: "稍小", value: "small" },
|
||||
{ label: "大", value: "large" },
|
||||
{ label: "中", value: "default" },
|
||||
{ label: "小", value: "small" },
|
||||
]);
|
||||
|
||||
function handleSetSize(size) {
|
||||
proxy.$modal.loading("正在设置布局大小,请稍候...");
|
||||
proxy.$modal.loading("正在切换布局大小,请稍后...");
|
||||
appStore.setSize(size);
|
||||
setTimeout("window.location.reload()", 1000);
|
||||
setTimeout("window.location.reload()", 500);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
<dict-tag :options="sys_is_del" :value="scope.row.isDel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
|
|
|
@ -107,14 +107,18 @@
|
|||
<dict-tag :options="sys_use_status" :value="scope.row.useStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="添加用户" align="center" prop="createBy" />
|
||||
<el-table-column label="添加时间" align="center" prop="subDeptLeaderPhone" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批状态" align="center" prop="approveStatus" >
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_approve_status" :value="scope.row.approveStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" fixed="right" width="150" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:proProjectInfoSubdepts:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:proProjectInfoSubdepts:remove']">删除</el-button>
|
||||
|
@ -131,7 +135,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改分包单位对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body custom-class="SubdeptsDlg">
|
||||
<el-form ref="proProjectInfoSubdeptsRef" :model="form" :rules="rules" label-width="88px">
|
||||
<el-tabs
|
||||
v-model="activeTabs"
|
||||
|
@ -153,10 +157,10 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入单位名称" />
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入单位名称" maxlength="64" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label="信用代码" prop="subDeptCode">
|
||||
<el-input v-model="form.subDeptCode" placeholder="请输入信用代码" />
|
||||
<el-input v-model="form.subDeptCode" placeholder="请输入信用代码" maxlength="64" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label="进场时间" prop="useDates">
|
||||
<el-date-picker
|
||||
|
@ -176,52 +180,58 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="承包范围" prop="subDeptCode">
|
||||
<el-input v-model="form.subDeptCode" placeholder="请输入承包范围" />
|
||||
<el-form-item label="承包范围" prop="contractInfos" v-if="form.subDeptType=='4' || form.subDeptType=='5'">
|
||||
<el-input v-model="form.contractInfos" maxlength="2000" show-word-limit type="textarea" rows="4" placeholder="请输入承包范围" />
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="单位信息" name="infos">
|
||||
<el-form-item label="经营范围" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入经营范围" />
|
||||
<el-form-item label="经营范围">
|
||||
<el-input v-model="form.subDeptInfos.busScope" maxlength="2000" show-word-limit type="textarea" rows="3" placeholder="请输入经营范围" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册日期" prop="useDates">
|
||||
<el-form-item label="注册日期">
|
||||
<el-date-picker
|
||||
v-model="form.useDates"
|
||||
v-model="form.subDeptInfos.signDate"
|
||||
type="date"
|
||||
placeholder="请选择注册日期"
|
||||
style="width:100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司地址" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入公司地址" />
|
||||
<el-form-item label="公司地址">
|
||||
<el-input v-model="form.subDeptInfos.address" maxlength="200" show-word-limit type="textarea" rows="2" placeholder="请输入公司地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入公司电话" />
|
||||
<el-form-item label="营业执照" prop="businessLicensePath">
|
||||
<image-upload v-model="form.businessLicensePath" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人电话" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入联系人电话" />
|
||||
<el-form-item label="企业联系人">
|
||||
<el-input v-model="form.subDeptInfos.person" maxlength="10" show-word-limit placeholder="请输入企业联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="法定代表人" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入法定代表人" />
|
||||
<el-form-item label="联系人电话">
|
||||
<el-input v-model="form.subDeptInfos.personPhone" maxlength="10" show-word-limit placeholder="请输入联系人电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="法人身份证" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入法人身份证" />
|
||||
<el-form-item label="法定代表人">
|
||||
<el-input v-model="form.subDeptInfos.legalPerson" maxlength="10" show-word-limit placeholder="请输入法定代表人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="获得奖项" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入获得奖项" />
|
||||
<el-form-item label="法人身份证">
|
||||
<el-input v-model="form.subDeptInfos.legalPersonCard" maxlength="18" show-word-limit placeholder="请输入法人身份证" />
|
||||
</el-form-item>
|
||||
<el-form-item label="企业评分" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入企业评分" />
|
||||
<el-form-item label="获得奖项">
|
||||
<el-input v-model="form.subDeptInfos.awards" maxlength="999" show-word-limit type="textarea" rows="3" placeholder="请输入获得奖项" />
|
||||
</el-form-item>
|
||||
<el-form-item label="企业评分">
|
||||
<el-input v-model="form.subDeptInfos.mark" maxlength="10" show-word-limit placeholder="请输入企业评分" />
|
||||
</el-form-item>
|
||||
<el-divider content-position="left" class="divider_title">银行卡信息</el-divider>
|
||||
<el-form-item label="支行名称" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入支行名称" />
|
||||
<el-form-item label="支行名称">
|
||||
<el-input v-model="form.subDeptInfos.bankName" maxlength="64" show-word-limit placeholder="请输入支行名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="银行卡号" prop="subDeptName">
|
||||
<el-input v-model="form.subDeptName" placeholder="请输入银行卡号" />
|
||||
<el-form-item label="银行卡号">
|
||||
<el-input v-model="form.subDeptInfos.bankNumber" maxlength="64" show-word-limit placeholder="请输入银行卡号" />
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="委托人信息" name="fourth" v-if="form.subDeptType=='4' || form.subDeptType=='5'">
|
||||
<el-tab-pane label="委托人信息" name="leader" v-if="form.subDeptType=='4' || form.subDeptType=='5'">
|
||||
<el-form-item label="单位委托书" prop="subDeptLeaderPowerPath">
|
||||
<image-upload v-model="form.subDeptLeaderPowerPath" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="委托人姓名" prop="subDeptLeaderName">
|
||||
<el-input v-model="form.subDeptLeaderName" placeholder="请输入委托人姓名" />
|
||||
</el-form-item>
|
||||
|
@ -231,6 +241,21 @@
|
|||
<el-form-item label="委托人电话" prop="subDeptLeaderPhone">
|
||||
<el-input v-model="form.subDeptLeaderPhone" placeholder="请输入委托人电话" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-form-item label="身份证正面">
|
||||
<image-upload v-model="form.leaderCardImgPos" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="身份证反面">
|
||||
<image-upload v-model="form.leaderCardImgInv" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="委托人照片">
|
||||
<image-upload v-model="form.leaderUserPicture" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
|
@ -266,7 +291,9 @@ const activeName = ref("all");
|
|||
const activeTabs = ref("base");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
form: {
|
||||
subDeptInfos:{}
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
|
@ -286,6 +313,12 @@ const data = reactive({
|
|||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
subDeptType: [{ required: true, message: "单位类型不能为空", trigger: "change" }],
|
||||
subDeptName: [{ required: true, message: "单位名称不能为空", trigger: "blur" }],
|
||||
subDeptCode: [{ required: true, message: "信用代码不能为空", trigger: "blur" }],
|
||||
useDates: [{ required: true, message: "进场时间不能为空", trigger: "change" }],
|
||||
useStatus: [{ required: true, message: "进场状态不能为空", trigger: "change" }],
|
||||
contractInfos: [{ required: true, message: "合同承包范围不能为空", trigger: "blur" }]
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -311,7 +344,7 @@ function cancel() {
|
|||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
deptId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
subDeptType: null,
|
||||
|
@ -321,6 +354,11 @@ function reset() {
|
|||
subDeptLeaderName: null,
|
||||
subDeptLeaderCode: null,
|
||||
subDeptLeaderPhone: null,
|
||||
subDeptLeaderPowerPath: null,
|
||||
businessLicensePath: null,
|
||||
subDeptInfos: null,
|
||||
contractInfos: null,
|
||||
useDates: null,
|
||||
useStatus: null,
|
||||
approveStatus: null,
|
||||
qrCode: null,
|
||||
|
@ -329,7 +367,8 @@ function reset() {
|
|||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
remark: null,
|
||||
subDeptInfos:{}
|
||||
};
|
||||
proxy.resetForm("proProjectInfoSubdeptsRef");
|
||||
}
|
||||
|
@ -360,6 +399,9 @@ function handleAdd() {
|
|||
return false;
|
||||
}
|
||||
reset();
|
||||
form.value.projectId = userStore.currentProId;
|
||||
form.value.projectName = userStore.currentProName;
|
||||
activeTabs.value = "base";
|
||||
open.value = true;
|
||||
title.value = "添加参建单位";
|
||||
}
|
||||
|
@ -369,6 +411,7 @@ function handleUpdate(row) {
|
|||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getProProjectInfoSubdepts(_id).then(response => {
|
||||
response.data.subDeptInfos = JSON.parse(response.data.subDeptInfos);
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改参建单位";
|
||||
|
@ -379,6 +422,7 @@ function handleUpdate(row) {
|
|||
function submitForm() {
|
||||
proxy.$refs["proProjectInfoSubdeptsRef"].validate(valid => {
|
||||
if (valid) {
|
||||
form.value.subDeptInfos = JSON.stringify(form.value.subDeptInfos);
|
||||
if (form.value.id != null) {
|
||||
updateProProjectInfoSubdepts(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
|
@ -386,6 +430,7 @@ function submitForm() {
|
|||
getList();
|
||||
});
|
||||
} else {
|
||||
form.value.approveStatus = 101;
|
||||
addProProjectInfoSubdepts(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
|
@ -416,9 +461,16 @@ function handleExport() {
|
|||
|
||||
getList();
|
||||
</script>
|
||||
<style scope>
|
||||
<style lang="scss" scope>
|
||||
.el-divider__text{
|
||||
color: #409eff;
|
||||
font-weight: 800;
|
||||
}
|
||||
.SubdeptsDlg{
|
||||
.el-dialog__body{
|
||||
margin-top: -25px;
|
||||
overflow: auto;
|
||||
max-height: 680px;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue