Compare commits

...

2 Commits

Author SHA1 Message Date
TL
981df09afa Merge remote-tracking branch '99/dev' into 99dev 2025-07-16 10:56:21 +08:00
TL
19d3c883fa 代码优化 2025-07-16 10:56:00 +08:00
12 changed files with 152 additions and 52 deletions

View File

@ -28,7 +28,7 @@ public class OrgController {
@ApiOperation("查询机构详细信息") @ApiOperation("查询机构详细信息")
@GetMapping("/{id}") @GetMapping("/{id}")
public BaseResponse<SysOrg> getOrgInfo(@ApiParam(value = "主键id", required = true) @PathVariable String id){ public BaseResponse<SysOrg> getOrgInfo(@ApiParam(value = "主键id", required = true) @PathVariable String id){
return orgService.getOrgInfo(id); return BaseResponse.success(orgService.getOrgInfo(id));
} }
@ApiOperation("查询机构列表") @ApiOperation("查询机构列表")

View File

@ -2,6 +2,7 @@ package com.chinaunicom.zyhy.ebtp.supplier.base.service;
import com.chinaunicom.mall.ebtp.common.base.entity.*; import com.chinaunicom.mall.ebtp.common.base.entity.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.OrgDeptVo;
import java.util.List; import java.util.List;
@ -24,7 +25,11 @@ public interface IOrgService {
* @param id * @param id
* @return * @return
*/ */
BaseResponse<SysOrg> getOrgInfo(String id); SysOrg getOrgInfo(String id);
OrgDeptVo getOrgDeptInfo(String id);
/** /**
* 查询机构列表 * 查询机构列表

View File

@ -5,8 +5,10 @@ import com.chinaunicom.mall.ebtp.common.base.client.SystemClient;
import com.chinaunicom.mall.ebtp.common.base.entity.*; import com.chinaunicom.mall.ebtp.common.base.entity.*;
import com.chinaunicom.mall.ebtp.common.base.util.TokenUtil; import com.chinaunicom.mall.ebtp.common.base.util.TokenUtil;
import com.chinaunicom.zyhy.ebtp.supplier.base.service.IOrgService; import com.chinaunicom.zyhy.ebtp.supplier.base.service.IOrgService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.OrgDeptVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -34,8 +36,24 @@ public class OrgServiceImpl implements IOrgService {
* @return * @return
*/ */
@Override @Override
public BaseResponse<SysOrg> getOrgInfo(String id) { public SysOrg getOrgInfo(String id) {
return systemClient.getOrgInfo(id); return systemClient.getOrgInfo(id).getData();
}
@Override
public OrgDeptVo getOrgDeptInfo(String id) {
OrgDeptVo orgDeptVo = new OrgDeptVo();
SysOrg dept = systemClient.getOrgInfo(id).getData();
if(!ObjectUtils.isEmpty(dept)){
SysOrg org = systemClient.getOrgInfo(dept.getUpOrgId()).getData();
if(!ObjectUtils.isEmpty(org)){
orgDeptVo.setOrgId(org.getOrgId());
orgDeptVo.setOrgName(org.getOrgName());
}
orgDeptVo.setDeptId(dept.getOrgId());
orgDeptVo.setDeptName(dept.getOrgName());
}
return orgDeptVo;
} }
/** /**

View File

@ -4,7 +4,9 @@ import javax.validation.Valid;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaunicom.mall.ebtp.common.base.controller.BaseController; import com.chinaunicom.mall.ebtp.common.base.controller.BaseController;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.base.util.TokenUtil;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoMessage; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoMessage;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoMessageService; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoMessageService;
@ -34,6 +36,10 @@ public class CoscoMessageController extends BaseController {
@ApiOperation("查询分页数据") @ApiOperation("查询分页数据")
@PostMapping("/page") @PostMapping("/page")
public BaseResponse<IPage<CoscoMessage>> page(@ApiParam(value = "对象数据", required = true) @RequestBody CoscoMessage coscoMessage) { public BaseResponse<IPage<CoscoMessage>> page(@ApiParam(value = "对象数据", required = true) @RequestBody CoscoMessage coscoMessage) {
//获取登录人供应商id
BaseCacheUser currentUser = TokenUtil.getCurrentUser();
String userId = currentUser.getUserId();//登录人id
coscoMessage.setReceiverId(userId);
return BaseResponse.success(coscoMessageService.getPage(coscoMessage)); return BaseResponse.success(coscoMessageService.getPage(coscoMessage));
} }
@ -55,7 +61,9 @@ public class CoscoMessageController extends BaseController {
coscoMessage.setRead(0l);//未读 coscoMessage.setRead(0l);//未读
coscoMessage.setType(MessageType.MESSAGETYPE_GYSPLTC); coscoMessage.setType(MessageType.MESSAGETYPE_GYSPLTC);
//获取登录人供应商id //获取登录人供应商id
coscoMessage.setReceiverId("1939870786604302336"); BaseCacheUser currentUser = TokenUtil.getCurrentUser();
String userId = currentUser.getUserId();//登录人id
coscoMessage.setReceiverId(userId);
return BaseResponse.success(coscoMessageService.getExitMge(coscoMessage)); return BaseResponse.success(coscoMessageService.getExitMge(coscoMessage));
} }

View File

@ -300,7 +300,9 @@ public class CoscoSupplierBaseController extends BaseController {
//如果id是就自己查 //如果id是就自己查
if(StringUtils.isEmpty(vo.getSupplierId())){ if(StringUtils.isEmpty(vo.getSupplierId())){
//获取登录人信息 //获取登录人信息
vo.setSupplierId("1939870859522277376"); BaseCacheUser currentUser = TokenUtil.getCurrentUser();
String userId = currentUser.getUserId();//登录人id
vo.setSupplierId(userId);
} }
return BaseResponse.success(coscoSupplierBaseService.getZrCategoryPage(vo)); return BaseResponse.success(coscoSupplierBaseService.getZrCategoryPage(vo));
} }
@ -316,7 +318,9 @@ public class CoscoSupplierBaseController extends BaseController {
@GetMapping("/getSupplierInfo/{id}") @GetMapping("/getSupplierInfo/{id}")
public BaseResponse<CoscoSupplierBase> getCoscoSupplierBase(@ApiParam(value = "主键id", required = true) @PathVariable String id){ public BaseResponse<CoscoSupplierBase> getCoscoSupplierBase(@ApiParam(value = "主键id", required = true) @PathVariable String id){
//获取登录人信息 //获取登录人信息
id = "1942424482567487488"; //获取登录人信息
BaseCacheUser currentUser = TokenUtil.getCurrentUser();
id = currentUser.getUserId();//登录人id
return BaseResponse.success(coscoSupplierBaseService.getCoscoSupplierBase(id)); return BaseResponse.success(coscoSupplierBaseService.getCoscoSupplierBase(id));
} }

View File

@ -92,4 +92,9 @@ public class CoscoAccessWork extends CoscoBaseEntity {
//品类名集合 //品类名集合
private List<String> categoryNameList; private List<String> categoryNameList;
//单位名称
private String orgName;
//部门名称
private String deptName;
} }

View File

@ -39,5 +39,7 @@ public class CoscoSupplierSurveyQuestionReply extends CoscoBaseEntity {
//@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd") //@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastUpdateTime; private Date lastUpdateTime;
//问题名
private String questionName;
} }

View File

@ -3,8 +3,10 @@ package com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser; import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
import com.chinaunicom.mall.ebtp.common.base.entity.SysOrg;
import com.chinaunicom.mall.ebtp.common.base.util.TokenUtil; import com.chinaunicom.mall.ebtp.common.base.util.TokenUtil;
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils; import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
import com.chinaunicom.zyhy.ebtp.supplier.base.service.IOrgService;
import com.chinaunicom.zyhy.ebtp.supplier.common.CoscoDateUtils; import com.chinaunicom.zyhy.ebtp.supplier.common.CoscoDateUtils;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.CoscoType;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType; import com.chinaunicom.zyhy.ebtp.supplier.base.constant.MessageType;
@ -14,10 +16,7 @@ import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.CoscoSupplier
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.*; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.*; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.*; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.CoscoAccessItemVo; import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.CoscoAccessUserItemVo;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.CoscoAccessWorkVo;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo.CoscoSupplierAccessWorkVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -62,6 +61,8 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
private ICoscoAccessItemAttachmentsService coscoAccessItemAttachmentsService; private ICoscoAccessItemAttachmentsService coscoAccessItemAttachmentsService;
@Autowired @Autowired
private ICoscoMessageService coscoMessageService; private ICoscoMessageService coscoMessageService;
@Autowired
private IOrgService orgService;
/** /**
@ -74,7 +75,13 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize()); IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize());
//只查询供应商准入 //只查询供应商准入
data.setApplyType(CoscoType.APPLY_TYPE_GYSZR); data.setApplyType(CoscoType.APPLY_TYPE_GYSZR);
return coscoAccessWorkMapper.selectPageList(page, data); IPage<CoscoAccessWork> pageData = coscoAccessWorkMapper.selectPageList(page, data);
for(CoscoAccessWork coscoAccessWork : pageData.getRecords()){
OrgDeptVo orgDeptVo = orgService.getOrgDeptInfo(coscoAccessWork.getDeptId());
coscoAccessWork.setOrgName(orgDeptVo.getOrgName());
coscoAccessWork.setDeptName(orgDeptVo.getDeptName());
}
return pageData;
} }
@Override @Override
@ -82,7 +89,7 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize()); IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize());
//只查询供应商准入 //只查询供应商准入
data.setApplyType(CoscoType.APPLY_TYPE_GYSZR); data.setApplyType(CoscoType.APPLY_TYPE_GYSZR);
return coscoAccessWorkMapper.selectCoscoAccessWorkUserReviewPage(page, data); return coscoAccessWorkMapper.selectCoscoAccessWorkUserReviewPage(page, data);
} }
@Override @Override

View File

@ -173,6 +173,15 @@ public class CoscoSupplierBaseServiceImpl extends BaseServiceImpl<CoscoSupplierB
CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments = new CoscoSupplierSurveyAttachments(); CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments = new CoscoSupplierSurveyAttachments();
coscoSupplierSurveyAttachments.setSupplierId(id); coscoSupplierSurveyAttachments.setSupplierId(id);
vo.setCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachmentsMapper.selectCoscoSupplierSurveyAttachmentsList(coscoSupplierSurveyAttachments)); vo.setCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachmentsMapper.selectCoscoSupplierSurveyAttachmentsList(coscoSupplierSurveyAttachments));
//填写人信息
CoscoSupplierSurvey coscoSupplierSurvey = new CoscoSupplierSurvey();
coscoSupplierSurvey.setSupplierId(id);
vo.setCoscoSupplierSurvey(coscoSupplierSurveyMapper.selectCoscoSupplierSurveyList(coscoSupplierSurvey).get(0));
//问题回复信息
CoscoSupplierSurveyQuestionReply coscoSupplierSurveyQuestionReply = new CoscoSupplierSurveyQuestionReply();
coscoSupplierSurveyQuestionReply.setSupplierId(id);
vo.setCoscoSupplierSurveyQuestionReply(coscoSupplierSurveyQuestionReplyMapper.selectCoscoSupplierSurveyQuestionReplyList(coscoSupplierSurveyQuestionReply));
return vo; return vo;
} }

View File

@ -0,0 +1,26 @@
package com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.vo;
import lombok.Data;
@Data
public class OrgDeptVo {
/**
* 单位id
*/
String orgId;
/**
* 部门id
*/
String deptId;
/**
* 单位名
*/
String orgName;
/**
* 部门名
*/
String deptName;
}

View File

@ -29,30 +29,31 @@
<select id="selectCoscoSupplierSurveyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurvey" resultMap="CoscoSupplierSurveyResult"> <select id="selectCoscoSupplierSurveyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurvey" resultMap="CoscoSupplierSurveyResult">
<include refid="selectCoscoSupplierSurveyVo"/> <include refid="selectCoscoSupplierSurveyVo"/>
<where> <where>
<if test="supplierId != null and supplierId != ''"> del_flag = 'normal'
and supplier_id = #{supplierId} <if test="supplierId != null and supplierId != ''">
</if> and supplier_id = #{supplierId}
<if test="supplierName != null and supplierName != ''"> </if>
and supplier_name like concat('%', #{supplierName}, '%') <if test="supplierName != null and supplierName != ''">
</if> and supplier_name like concat('%', #{supplierName}, '%')
<if test="name != null and name != ''"> </if>
and name like concat('%', #{name}, '%') <if test="name != null and name != ''">
</if> and name like concat('%', #{name}, '%')
<if test="position != null and position != ''"> </if>
and position = #{position} <if test="position != null and position != ''">
</if> and position = #{position}
<if test="phone != null and phone != ''"> </if>
and phone = #{phone} <if test="phone != null and phone != ''">
</if> and phone = #{phone}
<if test="email != null and email != ''"> </if>
and email = #{email} <if test="email != null and email != ''">
</if> and email = #{email}
<if test="dateTime != null "> </if>
and date_time = #{dateTime} <if test="dateTime != null ">
</if> and date_time = #{dateTime}
<if test="lastUpdateTime != null "> </if>
and last_update_time = #{lastUpdateTime} <if test="lastUpdateTime != null ">
</if> and last_update_time = #{lastUpdateTime}
</if>
</where> </where>
</select> </select>

View File

@ -15,35 +15,50 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="lastUpdateTime" column="last_update_time"/> <result property="lastUpdateTime" column="last_update_time"/>
<result property="questionName" column="question_name"/>
</resultMap> </resultMap>
<sql id="selectCoscoSupplierSurveyQuestionReplyVo"> <sql id="selectCoscoSupplierSurveyQuestionReplyVo">
select id, supplier_id, survey_question_id, reply_value, del_flag, create_by, create_time, update_by, update_time, last_update_time SELECT
from cosco_supplier_survey_question_reply cssqr.id,
cssqr.supplier_id,
cssqr.survey_question_id,
csq.question_name,
cssqr.reply_value,
cssqr.del_flag,
cssqr.create_by,
cssqr.create_time,
cssqr.update_by,
cssqr.update_time,
cssqr.last_update_time
FROM
cosco_supplier_survey_question_reply cssqr
LEFT JOIN cosco_survey_question csq ON cssqr.survey_question_id = csq.id
</sql> </sql>
<select id="selectCoscoSupplierSurveyQuestionReplyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyQuestionReply" resultMap="CoscoSupplierSurveyQuestionReplyResult"> <select id="selectCoscoSupplierSurveyQuestionReplyList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyQuestionReply" resultMap="CoscoSupplierSurveyQuestionReplyResult">
<include refid="selectCoscoSupplierSurveyQuestionReplyVo"/> <include refid="selectCoscoSupplierSurveyQuestionReplyVo"/>
<where> <where>
<if test="supplierId != null and supplierId != ''"> cssqr.del_flag = 'normal'
and supplier_id = #{supplierId} <if test="supplierId != null and supplierId != ''">
</if> and cssqr.supplier_id = #{supplierId}
<if test="surveyQuestionId != null and surveyQuestionId != ''"> </if>
and survey_question_id = #{surveyQuestionId} <if test="surveyQuestionId != null and surveyQuestionId != ''">
</if> and cssqr.survey_question_id = #{surveyQuestionId}
<if test="replyValue != null and replyValue != ''"> </if>
and reply_value = #{replyValue} <if test="replyValue != null and replyValue != ''">
</if> and cssqr.reply_value = #{replyValue}
<if test="lastUpdateTime != null "> </if>
and last_update_time = #{lastUpdateTime} <if test="lastUpdateTime != null ">
</if> and cssqr.last_update_time = #{lastUpdateTime}
</if>
</where> </where>
</select> </select>
<select id="selectCoscoSupplierSurveyQuestionReplyById" parameterType="String" <select id="selectCoscoSupplierSurveyQuestionReplyById" parameterType="String"
resultMap="CoscoSupplierSurveyQuestionReplyResult"> resultMap="CoscoSupplierSurveyQuestionReplyResult">
<include refid="selectCoscoSupplierSurveyQuestionReplyVo"/> <include refid="selectCoscoSupplierSurveyQuestionReplyVo"/>
where id = #{id} where cssqr.id = #{id}
</select> </select>
<insert id="insertCoscoSupplierSurveyQuestionReply" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyQuestionReply"> <insert id="insertCoscoSupplierSurveyQuestionReply" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyQuestionReply">