bug修改

This commit is contained in:
guoshengxiong 2024-04-18 18:15:46 +08:00
parent ff1d2ca1ad
commit e5a3c4b4cc
15 changed files with 170 additions and 430 deletions

View File

@ -198,14 +198,39 @@ public class EnterpriseInfo implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "是否是项目部公司1否2是")
private java.lang.Integer departmentType;
private java.lang.Integer departmentType;
@TableField(exist = false)
@ApiModelProperty(value = "项目负责人列表")
private List<ProjectEnterprisePerson> personList;
@TableField(exist = false)
@ApiModelProperty(value = "项目负责人列表")
private List<ProjectEnterprisePerson> personList;
@TableField(exist = false)
private String companyTypeName;
@TableField(exist = false)
private String projectEnterpriseId;
/**
* xz_supplier_type表外键
*/
@TableField(exist = false)
@ApiModelProperty(value = "企业类型Id")
private java.lang.Long xzSupplierTypeId;
/**
* xz_supplier_type表外键
*/
@TableField(exist = false)
@ApiModelProperty(value = "父级企业ID")
private java.lang.Long pid;
@TableField(exist = false)
@ApiModelProperty(value = "企业类型名称")
private java.lang.String xzSupplierTypeName;
@TableField(exist = false)
private String xzUserToSupplierId;
@TableField(exist = false)
@ApiModelProperty(value = "用户id")
private java.lang.Long userId;
@TableField(exist = false)
private String companyTypeName;
@TableField(exist = false)
private String projectEnterpriseId;
}

View File

@ -33,4 +33,14 @@ public interface EnterpriseInfoMapper extends BaseMapper<EnterpriseInfo> {
List<Map<String, Object>> selectDepartmentEnterpriseList(Map<String, Object> map);
List<Map<String, Object>> selectChildrenDepartmentEnterpriseList(Map<String, Object> map);
List<EntityMap> getXzSupplierList(@Param("map") Map<String, Object> map);
IPage<EntityMap> getXzSupplierPage(@Param("map") Map<String, Object> map, @Param("page") Page<EnterpriseInfo> qp);
EnterpriseInfo getXzSupplierByUserId(Map<String, Object> map);
EnterpriseInfo getXzSupplierBySocialCode(Map<String, Object> map);
List<EnterpriseInfo> getAllXzSupplierList(Map<String, Object> map);
}

View File

@ -72,11 +72,67 @@
<select id="selectChildrenDepartmentEnterpriseList" resultType="java.util.Map">
SELECT b.enterprise_id enterpriseId,b.parent_enterprise_id parentEnterpriseId
from enterprise_info a INNER JOIN project_enterprise b ON a.id=b.enterprise_id
where b.project_sn=#{projectSn}
where b.project_sn=#{projectSn}
and b.parent_enterprise_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<sql id="getXzSupplierList">
SELECT a.*,b.user_id,c.company_type_name
xz_supplier_type_name,b.xz_supplier_type_id,b.project_director_name,b.sort_num,
b.project_director_phone,b.pid,b.xz_supplier_id,b.department_type
from enterprise_info a INNER JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
LEFT JOIN xz_supplier_type c ON b.xz_supplier_type_id=c.id
WHERE b.user_id=#{map.userId}
<if test="map.enterpriseName != null and map.enterpriseName != ''">
and a.enterprise_name like CONCAT(CONCAT('%',#{map.enterpriseName}),'%')
</if>
<if test="map.xzSupplierTypeId != null and map.xzSupplierTypeId != ''">
and b.xz_supplier_type_id=#{map.xzSupplierTypeId}
</if>
<if test="map.userXzSupplierId != null and map.userXzSupplierId != ''">
and FIND_IN_SET(a.id,#{map.userXzSupplierId})
</if>
<if test="map.xzSupplierIds != null and map.xzSupplierIds.size() != 0">
and a.id in
<foreach collection="map.xzSupplierIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by b.sort_num
</sql>
<select id="getXzSupplierList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap" parameterType="map">
<include refid="getXzSupplierList">
</include>
</select>
<select id="getXzSupplierPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap" parameterType="map">
<include refid="getXzSupplierList">
</include>
</select>
<select id="getXzSupplierByUserId" resultType="com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo"
parameterType="map">
SELECT
a.*,b.user_id,c.company_type_name,b.xz_supplier_type_id,b.project_director_name,b.project_director_phone
from enterprise_info a INNER JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
LEFT JOIN xz_supplier_type c ON b.xz_supplier_type_id=c.id
WHERE b.user_id=#{userId}
</select>
<select id="getXzSupplierBySocialCode" resultType="com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo"
parameterType="map">
SELECT a.*
from enterprise_info a
where a.social_code like CONCAT(CONCAT('%',#{socialCode}),'%')
</select>
<select id="getAllXzSupplierList" resultType="com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo">
SELECT DISTINCT a.*
FROM enterprise_info a LEFT JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
LEFT JOIN project c ON b.project_sn=c.project_sn
LEFT JOIN company d ON c.company_sn=d.company_sn
WHERE d.headquarters_sn=#{headquartersSn}
<if test="xzSupplierName != null and xzSupplierName != ''">
and a.xz_supplier_name like CONCAT(CONCAT('%',#{xzSupplierName}),'%')
</if>
</select>
</mapper>

View File

@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.xz.service.IXzSupplierService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -93,7 +93,7 @@ public class XzSupplierController {
@OperLog(operModul = "供应商管理", operType = "添加星纵-供应商", operDesc = "添加星纵-供应商")
@ApiOperation(value = "添加星纵-供应商信息", notes = "添加星纵-供应商信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result add(@RequestBody XzSupplier xzSupplier) {
public Result add(@RequestBody EnterpriseInfo xzSupplier) {
xzSupplierService.saveXzSupplier(xzSupplier);
return Result.ok();
}
@ -107,7 +107,7 @@ public class XzSupplierController {
@OperLog(operModul = "供应商管理", operType = "编辑星纵-供应商", operDesc = "编辑星纵-供应商")
@ApiOperation(value = "编辑星纵-供应商信息", notes = "编辑星纵-供应商信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<XzSupplier> edit(@RequestBody XzSupplier xzSupplier) {
public Result<EnterpriseInfo> edit(@RequestBody EnterpriseInfo xzSupplier) {
xzSupplierService.updateXzSupplier(xzSupplier);
return Result.ok();
}
@ -115,7 +115,7 @@ public class XzSupplierController {
@OperLog(operModul = "供应商管理", operType = "保存星纵-供应商", operDesc = "保存星纵-供应商")
@ApiOperation(value = "保存星纵-供应商信息", notes = "保存星纵-供应商信息", httpMethod = "POST")
@PostMapping(value = "/saveSupplier")
public Result<XzSupplier> saveSupplier(@RequestBody XzSupplier xzSupplier) {
public Result<EnterpriseInfo> saveSupplier(@RequestBody EnterpriseInfo xzSupplier) {
xzSupplierService.saveSupplier(xzSupplier);
return Result.ok();
}
@ -128,7 +128,7 @@ public class XzSupplierController {
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/delete")
public Result<XzSupplier> delete(@RequestBody Map<String, Object> map) {
public Result<EnterpriseInfo> delete(@RequestBody Map<String, Object> map) {
xzSupplierService.removeXzSupplier(map);
return Result.ok();
}
@ -139,7 +139,7 @@ public class XzSupplierController {
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/getXzSupplierByUserId")
public Result<XzSupplier> getXzSupplierByUserId(@RequestBody Map<String, Object> map) {
public Result<EnterpriseInfo> getXzSupplierByUserId(@RequestBody Map<String, Object> map) {
return Result.success(xzSupplierService.getXzSupplierByUserId(map));
}
@ -149,7 +149,7 @@ public class XzSupplierController {
@ApiImplicitParam(name = "socialCode", value = "社会统一信用代码", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/getXzSupplierBySocialCode")
public Result<XzSupplier> getXzSupplierBySocialCode(@RequestBody Map<String, Object> map) {
public Result<EnterpriseInfo> getXzSupplierBySocialCode(@RequestBody Map<String, Object> map) {
return Result.success(xzSupplierService.getXzSupplierBySocialCode(map));
}
@ -159,7 +159,7 @@ public class XzSupplierController {
@ApiImplicitParam(name = "headquartersSn", value = "总公司sn", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/getAllXzSupplierList")
public Result<List<XzSupplier>> getAllXzSupplierList(@RequestBody Map<String, Object> map) {
public Result<List<EnterpriseInfo>> getAllXzSupplierList(@RequestBody Map<String, Object> map) {
return Result.success(xzSupplierService.getAllXzSupplierList(map));
}

View File

@ -5,7 +5,7 @@ import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.project.entity.XzUserToSupplier;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.xz.service.IXzUserToSupplierService;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
@ -51,8 +51,8 @@ public class XzUserToSupplierController {
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/list")
public Result<IPage<XzSupplier>> queryPageList(@RequestBody Map<String, Object> map) {
IPage<XzSupplier> pageList = xzUserToSupplierService.selectXzUserToSupplierPage(map);
public Result<IPage<EnterpriseInfo>> queryPageList(@RequestBody Map<String, Object> map) {
IPage<EnterpriseInfo> pageList = xzUserToSupplierService.selectXzUserToSupplierPage(map);
return Result.success(pageList);
}

View File

@ -1,225 +0,0 @@
package com.zhgd.xmgl.modules.xz.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: 星纵-供应商
* @author pds
* @date 2020-08-13
* @version V1.0
*/
@Data
@TableName("xz_supplier")
@ApiModel(value = "XzSupplier实体类", description = "XzSupplier")
public class XzSupplier implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 企业账号表
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "企业账号表")
private java.lang.Long id;
/**
* 企业名称
*/
@Excel(name = "企业名称", width = 15)
@ApiModelProperty(value = "企业名称")
private java.lang.String enterpriseName;
/**
* 描述
*/
@Excel(name = "描述", width = 15)
@ApiModelProperty(value = "描述")
private java.lang.String description;
/**
* 企业地址
*/
@Excel(name = "企业地址", width = 15)
@ApiModelProperty(value = "企业地址")
private java.lang.String enterpriseAddress;
/**
* 法定代表人
*/
@Excel(name = "法定代表人", width = 15)
@ApiModelProperty(value = "法定代表人")
private java.lang.String enterpriseLegalPerson;
/**
* 法定人证件号
*/
@Excel(name = "法定人证件号", width = 15)
@ApiModelProperty(value = "法定人证件号")
private java.lang.String legalPersonIdCard;
/**
* 企业安全生产许可证
*/
@Excel(name = "企业安全生产许可证", width = 15)
@ApiModelProperty(value = "企业安全生产许可证")
private java.lang.String enterpriseSafeAllow;
/**
* 单位性质 1.国有企业 2三资企业 3集体企业 4私营企业
*/
@Excel(name = "单位性质 1.国有企业 2三资企业 3集体企业 4私营企业", width = 15)
@ApiModelProperty(value = "单位性质 1.国有企业 2三资企业 3集体企业 4私营企业")
private java.lang.Integer enterpriseProperty;
/**
* 法人电话
*/
@Excel(name = "法人电话", width = 15)
@ApiModelProperty(value = "法人电话")
private java.lang.String legalPersonTel;
/**
* 社会统一信用代码
*/
@Excel(name = "社会统一信用代码", width = 15)
@ApiModelProperty(value = "社会统一信用代码")
private java.lang.String socialCode;
/**
* 营业执照注册号
*/
@Excel(name = "营业执照注册号", width = 15)
@ApiModelProperty(value = "营业执照注册号")
private java.lang.String businessNumber;
/**
* 资质证书号
*/
@Excel(name = "资质证书号", width = 15)
@ApiModelProperty(value = "资质证书号")
private java.lang.String qualificationNumber;
/**
* 企业邮箱
*/
@Excel(name = "企业邮箱", width = 15)
@ApiModelProperty(value = "企业邮箱")
private java.lang.String enterpriseEmail;
/**
* 注册资金
*/
@Excel(name = "注册资金", width = 15)
@ApiModelProperty(value = "注册资金")
private java.lang.String registeredCapital;
/**
* 开户行
*/
@Excel(name = "开户行", width = 15)
@ApiModelProperty(value = "开户行")
private java.lang.String bankname;
/**
* 银行卡号
*/
@Excel(name = "银行卡号", width = 15)
@ApiModelProperty(value = "银行卡号")
private java.lang.String bankcardnumber;
/**
* 银行代码
*/
@Excel(name = "银行代码", width = 15)
@ApiModelProperty(value = "银行代码")
private java.lang.String bankcode;
/**
* 企业资质图片地址
*/
@Excel(name = "企业资质图片地址", width = 15)
@ApiModelProperty(value = "企业资质图片地址")
private java.lang.String enterpriseQualificationUrl;
/**
* 营业执照截止日期
*/
@Excel(name = "营业执照截止日期", width = 15)
@ApiModelProperty(value = "营业执照截止日期")
private java.lang.String businessLicenseEndDate;
/**
* 注册人姓名
*/
@Excel(name = "注册人姓名", width = 15)
@ApiModelProperty(value = "注册人姓名")
private java.lang.String registerPersonName;
/**
* 注册人电话
*/
@Excel(name = "注册人电话 ", width = 15)
@ApiModelProperty(value = "注册人电话 ")
private java.lang.String registerPersonPhoneTel;
/**
* 企业sn
*/
@Excel(name = "企业sn", width = 15)
@ApiModelProperty(value = "企业sn")
private java.lang.String enterpriseSn;
/**
* logo
*/
@Excel(name = "logo", width = 15)
@ApiModelProperty(value = "logo")
private java.lang.String logo;
/**
* 企业注册日期
*/
@Excel(name = "企业注册日期", width = 15)
@ApiModelProperty(value = "企业注册日期")
private java.lang.String registDate;
@Excel(name = "营业执照图片地址", width = 15)
@ApiModelProperty(value = "营业执照图片地址")
private java.lang.String businessLicenseUrl;
/**
* xz_supplier_type表外键
*/
@TableField(exist = false)
@ApiModelProperty(value = "企业类型Id")
private java.lang.Long xzSupplierTypeId;
/**
* xz_supplier_type表外键
*/
@TableField(exist = false)
@ApiModelProperty(value = "父级企业ID")
private java.lang.Long pid;
@TableField(exist = false)
@ApiModelProperty(value = "排序")
private java.lang.Integer sortNum;
@TableField(exist = false)
@ApiModelProperty(value = "企业类型名称")
private java.lang.String xzSupplierTypeName;
@TableField(exist = false)
@ApiModelProperty(value = "类型1项目2企业")
private java.lang.Integer type;
@TableField(exist = false)
@ApiModelProperty(value = "项目负责人")
private java.lang.String projectDirectorName;
@TableField(exist = false)
@ApiModelProperty(value = "项目负责人电话")
private java.lang.String projectDirectorPhone;
@TableField(exist = false)
@ApiModelProperty(value = "是否是项目部公司1否2是")
private java.lang.Integer departmentType;
@TableField(exist = false)
private String companyTypeName;
@TableField(exist = false)
private String xzUserToSupplierId;
@TableField(exist = false)
@ApiModelProperty(value = "用户id")
private java.lang.Long userId;
}

View File

@ -1,36 +0,0 @@
package com.zhgd.xmgl.modules.xz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @Description: 星纵-供应商
* @author pds
* @date 2020-08-13
* @version V1.0
*/
@Mapper
public interface XzSupplierMapper extends BaseMapper<XzSupplier> {
List<EntityMap> getXzSupplierList(@Param("map") Map<String, Object> map);
IPage<EntityMap> getXzSupplierPage(@Param("map") Map<String, Object> map, @Param("page") Page<XzSupplier> qp);
XzSupplier getXzSupplierByUserId(Map<String, Object> map);
XzSupplier getXzSupplierBySocialCode(Map<String, Object> map);
List<XzSupplier> getAllXzSupplierList(Map<String, Object> map);
List<Map<String, Object>> selectDepartmentXzSupplierList(Map<String, Object> map);
List<Map<String, Object>> selectChildrenDepartmentXzSupplierList(Map<String, Object> map);
}

View File

@ -5,7 +5,7 @@ import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.zhgd.xmgl.modules.project.entity.XzUserToSupplier;
@ -22,7 +22,7 @@ import org.springframework.stereotype.Repository;
@Repository
public interface XzUserToSupplierMapper extends BaseMapper<XzUserToSupplier> {
List<XzSupplier> selectXzUserToSupplierPage(Page<XzSupplier> page, @Param("param") Map<String, Object> map);
List<EnterpriseInfo> selectXzUserToSupplierPage(Page<EnterpriseInfo> page, @Param("param") Map<String, Object> map);
List<EntityMap> selectXzUserToSupplierList(Map<String, Object> map);

View File

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.xz.mapper.XzSupplierMapper">
<sql id="getXzSupplierList">
SELECT a.*,b.user_id,c.company_type_name
xz_supplier_type_name,b.xz_supplier_type_id,b.project_director_name,b.sort_num,
b.project_director_phone,b.pid,b.xz_supplier_id,b.department_type
from xz_supplier a INNER JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
LEFT JOIN xz_supplier_type c ON b.xz_supplier_type_id=c.id
WHERE b.user_id=#{map.userId}
<if test="map.enterpriseName != null and map.enterpriseName != ''">
and a.enterprise_name like CONCAT(CONCAT('%',#{map.enterpriseName}),'%')
</if>
<if test="map.xzSupplierTypeId != null and map.xzSupplierTypeId != ''">
and b.xz_supplier_type_id=#{map.xzSupplierTypeId}
</if>
<if test="map.userXzSupplierId != null and map.userXzSupplierId != ''">
and FIND_IN_SET(a.id,#{map.userXzSupplierId})
</if>
<if test="map.xzSupplierIds != null and map.xzSupplierIds.size() != 0">
and a.id in
<foreach collection="map.xzSupplierIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by b.sort_num
</sql>
<select id="getXzSupplierList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap" parameterType="map">
<include refid="getXzSupplierList">
</include>
</select>
<select id="getXzSupplierPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap" parameterType="map">
<include refid="getXzSupplierList">
</include>
</select>
<select id="getXzSupplierByUserId" resultType="com.zhgd.xmgl.modules.xz.entity.XzSupplier"
parameterType="map">
SELECT
a.*,b.user_id,c.company_type_name,b.xz_supplier_type_id,b.project_director_name,b.project_director_phone
from xz_supplier a INNER JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
LEFT JOIN xz_supplier_type c ON b.xz_supplier_type_id=c.id
WHERE b.user_id=#{userId}
</select>
<select id="getXzSupplierBySocialCode" resultType="com.zhgd.xmgl.modules.xz.entity.XzSupplier"
parameterType="map">
SELECT a.*
from xz_supplier a
where a.social_code like CONCAT(CONCAT('%',#{socialCode}),'%')
</select>
<select id="getAllXzSupplierList" resultType="com.zhgd.xmgl.modules.xz.entity.XzSupplier">
SELECT DISTINCT a.*
FROM xz_supplier a LEFT JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
LEFT JOIN project c ON b.project_sn=c.project_sn
LEFT JOIN company d ON c.company_sn=d.company_sn
WHERE d.headquarters_sn=#{headquartersSn}
<if test="xzSupplierName != null and xzSupplierName != ''">
and a.xz_supplier_name like CONCAT(CONCAT('%',#{xzSupplierName}),'%')
</if>
</select>
<select id="selectDepartmentXzSupplierList" resultType="java.util.Map">
SELECT cast(b.xz_supplier_id as char) xzSupplierId,a.xz_supplier_name xzSupplierName,b.parent_xz_supplier_id
parentXzSupplierId
from xz_supplier a INNER JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
where b.project_sn=#{projectSn} and b.department_type=2
<if test="xzSupplierId != null and xzSupplierId != ''">
and b.xz_supplier_id=#{xzSupplierId}
</if>
<if test="xzSupplierName != null and xzSupplierName != ''">
and a.xz_supplier_name like CONCAT(CONCAT('%',#{xzSupplierName}),'%')
</if>
ORDER BY sort_num
</select>
<select id="selectChildrenDepartmentXzSupplierList" resultType="java.util.Map">
SELECT b.xz_supplier_id xzSupplierId,b.parent_xz_supplier_id parentXzSupplierId
from xz_supplier a INNER JOIN xz_user_to_supplier b ON a.id=b.xz_supplier_id
where b.project_sn=#{projectSn}
and b.parent_xz_supplier_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.xz.mapper.XzUserToSupplierMapper">
<select id="selectXzUserToSupplierPage" resultType="com.zhgd.xmgl.modules.xz.entity.XzSupplier">
<select id="selectXzUserToSupplierPage" resultType="com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo">
SELECT a.*,
b.id
xz_user_to_supplier_id,
@ -12,7 +12,7 @@
b.parent_xz_supplier_id,
b.sort_num,
b.department_type
FROM xz_supplier a
FROM enterprise_info a
LEFT JOIN xz_user_to_supplier b ON a.id = b.xz_supplier_id
LEFT JOIN xz_supplier_type c ON b.xz_supplier_type_id = c.id
WHERE b.project_sn = #{param.projectSn}
@ -37,7 +37,7 @@
c.company_type_name,
b.project_director_name,
b.project_director_phone
FROM xz_supplier a
FROM enterprise_info a
LEFT JOIN xz_user_to_supplier b ON a.id = b.xz_supplier_id
LEFT JOIN xz_supplier_type c ON b.xz_supplier_type_id = c.id
WHERE b.project_sn = #{sn}
@ -55,7 +55,7 @@
</select>
<select id="selectProjectAllXzSupplierList" resultType="java.util.Map" parameterType="map">
SELECT cast(a.id as char) xzSupplierId, a.xz_supplier_name `name`, b.xz_supplier_type_id typeId
from xz_supplier a
from enterprise_info a
INNER JOIN xz_user_to_supplier b ON a.id = b.xz_supplier_id
WHERE b.project_sn = #{projectSn}
<if test="xzSupplierId != null and xzSupplierId != ''">
@ -91,7 +91,7 @@
b.xz_supplier_type_id companyTypeId,
a.social_code socialCode,
a.qualification_number qualificationNumber
FROM xz_supplier a
FROM enterprise_info a
LEFT JOIN xz_user_to_supplier b ON a.id = b.xz_supplier_id
LEFT JOIN xz_supplier_type c ON b.xz_supplier_type_id = c.id
WHERE b.project_sn = #{projectCode}

View File

@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.CompanyVo;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
@ -16,21 +16,21 @@ import java.util.Map;
* @date 2020-08-13
* @version V1.0
*/
public interface IXzSupplierService extends IService<XzSupplier> {
public interface IXzSupplierService extends IService<EnterpriseInfo> {
List<EntityMap> getXzSupplierList(Map<String, Object> map);
XzSupplier saveXzSupplier(XzSupplier xzSupplier);
EnterpriseInfo saveXzSupplier(EnterpriseInfo xzSupplier);
XzSupplier getXzSupplierByUserId(Map<String, Object> map);
EnterpriseInfo getXzSupplierByUserId(Map<String, Object> map);
void removeXzSupplier(Map<String, Object> map);
XzSupplier getXzSupplierBySocialCode(Map<String, Object> map);
EnterpriseInfo getXzSupplierBySocialCode(Map<String, Object> map);
XzSupplier updateXzSupplier(XzSupplier xzSupplier);
EnterpriseInfo updateXzSupplier(EnterpriseInfo xzSupplier);
List<XzSupplier> getAllXzSupplierList(Map<String, Object> map);
List<EnterpriseInfo> getAllXzSupplierList(Map<String, Object> map);
JSONArray selectHierarchyXzSupplierList(Map<String, Object> map);
@ -38,5 +38,5 @@ public interface IXzSupplierService extends IService<XzSupplier> {
IPage<EntityMap> getXzSupplierPage(Map<String, Object> map);
void saveSupplier(XzSupplier xzSupplier);
void saveSupplier(EnterpriseInfo xzSupplier);
}

View File

@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.project.entity.XzUserToSupplier;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import java.util.List;
import java.util.Map;
@ -17,7 +17,7 @@ import java.util.Map;
*/
public interface IXzUserToSupplierService extends IService<XzUserToSupplier> {
IPage<XzSupplier> selectXzUserToSupplierPage(Map<String, Object> map);
IPage<EnterpriseInfo> selectXzUserToSupplierPage(Map<String, Object> map);
void saveXzUserToSupplier(XzUserToSupplier xzUserToSupplier);

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.xz.entity.*;
import com.zhgd.xmgl.modules.xz.mapper.*;
import com.zhgd.xmgl.modules.xz.service.IXzSupplierQualificationApplyService;
@ -42,8 +43,6 @@ public class XzSupplierQualificationApplyServiceImpl extends ServiceImpl<XzSuppl
@Autowired
private XzSupplierQualificationMapper xzSupplierQualificationMapper;
@Autowired
private XzSupplierMapper xzSupplierMapper;
@Autowired
private XzSupplierServiceImpl xzSupplierService;
@Override
@ -129,7 +128,7 @@ public class XzSupplierQualificationApplyServiceImpl extends ServiceImpl<XzSuppl
//添加记录
HashMap<String, Object> map = new HashMap<>();
map.put("userId", userId);
XzSupplier xzSupplier = xzSupplierService.getXzSupplierByUserId(map);
EnterpriseInfo xzSupplier = xzSupplierService.getXzSupplierByUserId(map);
if (xzSupplier == null) {
throw new OpenAlertException("请先填报基本信息");
}

View File

@ -13,8 +13,8 @@ import com.zhgd.xmgl.base.CompanyVo;
import com.zhgd.xmgl.modules.project.entity.Project;
import com.zhgd.xmgl.modules.project.entity.XzUserToSupplier;
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import com.zhgd.xmgl.modules.xz.mapper.XzSupplierMapper;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
import com.zhgd.xmgl.modules.xz.mapper.XzUserToSupplierMapper;
import com.zhgd.xmgl.modules.xz.service.IXzSupplierService;
import com.zhgd.xmgl.util.ListUtils;
@ -38,24 +38,24 @@ import java.util.UUID;
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSupplier> implements IXzSupplierService {
public class XzSupplierServiceImpl extends ServiceImpl<EnterpriseInfoMapper, EnterpriseInfo> implements IXzSupplierService {
@Autowired
ProjectMapper projectMapper;
@Autowired
private XzSupplierMapper xzSupplierMapper;
private EnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
private XzUserToSupplierMapper xzUserToSupplierMapper;
@Override
public List<EntityMap> getXzSupplierList(Map<String, Object> map) {
return xzSupplierMapper.getXzSupplierList(map);
return enterpriseInfoMapper.getXzSupplierList(map);
}
@Override
public XzSupplier saveXzSupplier(XzSupplier xzSupplier) {
QueryWrapper<XzSupplier> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(XzSupplier::getSocialCode, xzSupplier.getSocialCode());
XzSupplier tempXzSupplier = xzSupplierMapper.selectOne(queryWrapper);
public EnterpriseInfo saveXzSupplier(EnterpriseInfo xzSupplier) {
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, xzSupplier.getSocialCode());
EnterpriseInfo tempXzSupplier = enterpriseInfoMapper.selectOne(queryWrapper);
if (xzSupplier.getPid() == null) {
xzSupplier.setPid(0L);
}
@ -69,11 +69,11 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
throw new OpenAlertException(MessageUtil.get("existsEnterpriseErr"));
}
xzSupplier.setId(tempXzSupplier.getId());
xzSupplierMapper.updateById(xzSupplier);
enterpriseInfoMapper.updateById(xzSupplier);
} else {
String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
xzSupplier.setEnterpriseSn(uuid);
xzSupplierMapper.insert(xzSupplier);
enterpriseInfoMapper.insert(xzSupplier);
}
xzUserToSupplier.setProjectDirectorName(xzSupplier.getProjectDirectorName());
xzUserToSupplier.setProjectDirectorPhone(xzSupplier.getProjectDirectorPhone());
@ -88,8 +88,8 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
}
@Override
public XzSupplier getXzSupplierByUserId(Map<String, Object> map) {
return xzSupplierMapper.getXzSupplierByUserId(map);
public EnterpriseInfo getXzSupplierByUserId(Map<String, Object> map) {
return enterpriseInfoMapper.getXzSupplierByUserId(map);
}
@Override
@ -106,16 +106,16 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
}
@Override
public XzSupplier getXzSupplierBySocialCode(Map<String, Object> map) {
return xzSupplierMapper.getXzSupplierBySocialCode(map);
public EnterpriseInfo getXzSupplierBySocialCode(Map<String, Object> map) {
return enterpriseInfoMapper.getXzSupplierBySocialCode(map);
}
@Override
public XzSupplier updateXzSupplier(XzSupplier xzSupplier) {
QueryWrapper<XzSupplier> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(XzSupplier::getSocialCode, xzSupplier.getSocialCode())
.ne(XzSupplier::getId, xzSupplier.getId());
int count = xzSupplierMapper.selectCount(queryWrapper);
public EnterpriseInfo updateXzSupplier(EnterpriseInfo xzSupplier) {
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, xzSupplier.getSocialCode())
.ne(EnterpriseInfo::getId, xzSupplier.getId());
int count = enterpriseInfoMapper.selectCount(queryWrapper);
if (count > 0) {
throw new OpenAlertException(MessageUtil.get("existsEnterpriseSocialCodeErr"));
}
@ -133,7 +133,7 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
if (xzSupplier.getPid() == null) {
xzSupplier.setPid(0L);
}
xzSupplierMapper.updateById(xzSupplier);
enterpriseInfoMapper.updateById(xzSupplier);
//保存企业和项目关联记录
QueryWrapper<XzUserToSupplier> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.lambda().eq(XzUserToSupplier::getXzSupplierId, xzSupplier.getId())
@ -150,13 +150,13 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
}
@Override
public List<XzSupplier> getAllXzSupplierList(Map<String, Object> map) {
return xzSupplierMapper.getAllXzSupplierList(map);
public List<EnterpriseInfo> getAllXzSupplierList(Map<String, Object> map) {
return enterpriseInfoMapper.getAllXzSupplierList(map);
}
@Override
public JSONArray selectHierarchyXzSupplierList(Map<String, Object> map) {
List<EntityMap> list = xzSupplierMapper.getXzSupplierList(map);
List<EntityMap> list = enterpriseInfoMapper.getXzSupplierList(map);
JSONArray result = ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(list)), "id", "parentXzSupplierId", "children");
return result;
}
@ -164,7 +164,7 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
@Override
public Map<String, Object> modCompany(CompanyVo companyVo) {
Map<String, Object> resultMap = new HashMap<>();
XzSupplier xzSupplier = new XzSupplier();
EnterpriseInfo xzSupplier = new EnterpriseInfo();
xzSupplier.setSocialCode(companyVo.getSocialCode());
xzSupplier.setEnterpriseName(companyVo.getCompanyName());
xzSupplier.setEnterpriseLegalPerson(companyVo.getCompanyLegalPerson());
@ -177,17 +177,17 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
xzSupplier.setQualificationNumber(companyVo.getQualificationNumber());
xzSupplier.setEnterpriseQualificationUrl(companyVo.getCompanyQualificationUrl());
xzSupplier.setBusinessLicenseEndDate(companyVo.getBusinessLicenseEndDate());
QueryWrapper<XzSupplier> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(XzSupplier::getSocialCode, xzSupplier.getSocialCode());
XzSupplier tempXzSupplier = xzSupplierMapper.selectOne(queryWrapper);
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, xzSupplier.getSocialCode());
EnterpriseInfo tempXzSupplier = enterpriseInfoMapper.selectOne(queryWrapper);
if (tempXzSupplier != null) {
xzSupplier.setId(tempXzSupplier.getId());
xzSupplierMapper.updateById(xzSupplier);
enterpriseInfoMapper.updateById(xzSupplier);
} else {
xzSupplier.setPid(0L);
String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
xzSupplier.setEnterpriseSn(uuid);
xzSupplierMapper.insert(xzSupplier);
enterpriseInfoMapper.insert(xzSupplier);
}
resultMap.put("msg", "操作成功");
resultMap.put("status", "1");
@ -199,15 +199,15 @@ public class XzSupplierServiceImpl extends ServiceImpl<XzSupplierMapper, XzSuppl
public IPage<EntityMap> getXzSupplierPage(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
Page<XzSupplier> qp = new Page<>(pageNo, pageSize);
return xzSupplierMapper.getXzSupplierPage(map, qp);
Page<EnterpriseInfo> qp = new Page<>(pageNo, pageSize);
return enterpriseInfoMapper.getXzSupplierPage(map, qp);
}
@Override
public void saveSupplier(XzSupplier xzSupplier) {
public void saveSupplier(EnterpriseInfo xzSupplier) {
HashMap<String, Object> map = new HashMap<>();
map.put("userId", xzSupplier.getUserId());
XzSupplier supplier = getXzSupplierByUserId(map);
EnterpriseInfo supplier = getXzSupplierByUserId(map);
if (supplier != null) {
xzSupplier.setId(supplier.getId());
updateXzSupplier(xzSupplier);

View File

@ -1,6 +1,5 @@
package com.zhgd.xmgl.modules.xz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -9,12 +8,10 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.project.entity.XzUserToSupplier;
import com.zhgd.xmgl.modules.project.service.IProjectService;
import com.zhgd.xmgl.modules.xz.entity.XzSupplier;
import com.zhgd.xmgl.modules.xz.mapper.XzSupplierMapper;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
import com.zhgd.xmgl.modules.xz.mapper.XzUserToSupplierMapper;
import com.zhgd.xmgl.modules.xz.service.IXzUserToSupplierService;
import com.zhgd.xmgl.security.entity.UserInfo;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.MessageUtil;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
@ -22,12 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Description: 星纵-用户和供应商关联
@ -41,19 +34,19 @@ public class XzUserToSupplierServiceImpl extends ServiceImpl<XzUserToSupplierMap
@Autowired
private XzUserToSupplierMapper xzUserToSupplierMapper;
@Autowired
private XzSupplierMapper xzSupplierMapper;
private EnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
private IProjectService projectService;
@Override
public IPage<XzSupplier> selectXzUserToSupplierPage(Map<String, Object> map) {
public IPage<EnterpriseInfo> selectXzUserToSupplierPage(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
Page<XzSupplier> page = new Page<>(pageNo, pageSize);
Page<EnterpriseInfo> page = new Page<>(pageNo, pageSize);
String projectSn = MapUtils.getString(map, "projectSn");
List<String> projectSnList = projectService.getProjectSnList(projectSn);
map.put("projectSnList", projectSnList);
List<XzSupplier> list = xzUserToSupplierMapper.selectXzUserToSupplierPage(page, map);
List<EnterpriseInfo> list = xzUserToSupplierMapper.selectXzUserToSupplierPage(page, map);
return page.setRecords(list);
}