代码优化

This commit is contained in:
TL
2025-07-03 15:09:48 +08:00
parent 1be76886e0
commit 880635a9a4
33 changed files with 307 additions and 98 deletions

View File

@ -0,0 +1,18 @@
package com.chinaunicom.zyhy.ebtp.supplier.common;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().permitAll()
.and()
.csrf().disable();
}
}

View File

@ -34,7 +34,7 @@ public class CoscoAccessWorkController extends BaseController {
@ApiOperation("查询分页数据")
@PostMapping("/getPage")
public BaseResponse<IPage<CoscoAccessWork>> getPage(@ApiParam(value = "对象数据", required = true) @RequestBody CoscoAccessWork data) {
data.setCreateBy("E0001");
data.setCreateBy("E0002");
return BaseResponse.success(coscoAccessWorkService.getPage(data));
}
@ -79,7 +79,7 @@ public class CoscoAccessWorkController extends BaseController {
@ApiOperation("查询数据")
@GetMapping("/reviewInfo")
public BaseResponse<List<CoscoAccessSupplier>> reviewInfo(@ApiParam(value = "主键id", required = true) String id,@ApiParam(value = "用户id", required = true) String userId){
userId = "E0001";
userId = "E0002";
return BaseResponse.success(coscoAccessWorkService.reviewInfo(id,userId));
}
@ -102,7 +102,7 @@ public class CoscoAccessWorkController extends BaseController {
@ApiOperation("修改数据")
@PostMapping("/update")
public BaseResponse<Boolean> update(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid CoscoAccessUserItemVo vo){
vo.setUserId("E0001");
vo.setUserId("E0002");
return BaseResponse.success(coscoAccessWorkService.updateCoscoAccessWork(vo));
}

View File

@ -66,7 +66,7 @@ public class CoscoSupplierBaseController extends BaseController {
*/
@ApiOperation("新增数据")
@PostMapping("/add")
public BaseResponse<Boolean> update(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid CoscoSupplierVo vo){
public BaseResponse<Integer> update(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid CoscoSupplierVo vo){
return BaseResponse.success(coscoSupplierBaseService.insertCoscoSupplierBase(vo));
}
@ -77,7 +77,7 @@ public class CoscoSupplierBaseController extends BaseController {
*/
@ApiOperation("新增数据")
@PostMapping("/addAgent")
public BaseResponse<Boolean> addAgent(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid CoscoSupplierVo vo){
public BaseResponse<Integer> addAgent(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid CoscoSupplierVo vo){
CoscoSupplierBase coscoSupplierBase = vo.getCoscoSupplierBase();
coscoSupplierBase.setFillinStatus(CoscoType.FILLIN_STATUS_S);//代录入标识
coscoSupplierBase.setFillinBy("1");//代理人
@ -149,7 +149,7 @@ public class CoscoSupplierBaseController extends BaseController {
// 动态设置导出字段(忽略未标注字段)
Set<String> includeFields = new HashSet<>(Arrays.asList(
"name","supplierTypeCn", "enterpriseType","categoryName","updateTime","accessStatusCn" // 指定要导出的字段名
"name","supplierTypeCn", "enterpriseTypeCn","categoryName","updateTime","accessStatusCn" // 指定要导出的字段名
));
String fileName = URLEncoder.encode("我的供应商.xlsx", "UTF-8");
@ -184,7 +184,7 @@ public class CoscoSupplierBaseController extends BaseController {
// 动态设置导出字段(忽略未标注字段)
Set<String> includeFields = new HashSet<>(Arrays.asList(
"name", "socialCreditCode","supplierTypeCn", "enterpriseType","createTime" // 指定要导出的字段名
"name", "socialCreditCode","supplierTypeCn", "enterpriseTypeCn","createTime" // 指定要导出的字段名
));
String fileName = URLEncoder.encode("合格供应商.xlsx", "UTF-8");

View File

@ -60,7 +60,7 @@ public class CoscoSupplierQualificationsController extends BaseController {
* 新增中远海运_供应商_资质信息
*/
@PostMapping
public BaseResponse<Boolean> add(@RequestBody CoscoSupplierQualifications coscoSupplierQualifications) {
public BaseResponse<Integer> add(@RequestBody CoscoSupplierQualifications coscoSupplierQualifications) {
return BaseResponse.success(coscoSupplierQualificationsService.insertCoscoSupplierQualifications(coscoSupplierQualifications));
}

View File

@ -58,7 +58,7 @@ public class CoscoSupplierSurveyAttachmentsController extends BaseController {
* 新增中远海运_供应商_承诺书及附件
*/
@PostMapping
public BaseResponse<Boolean> add(@RequestBody CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments) {
public BaseResponse<Integer> add(@RequestBody CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments) {
return BaseResponse.success(coscoSupplierSurveyAttachmentsService.insertCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachments));
}

View File

@ -42,6 +42,12 @@ public interface CoscoSupplierBankMapper extends IBaseMapper<CoscoSupplierBank>
*/
public int insertCoscoSupplierBank(CoscoSupplierBank coscoSupplierBank);
/**
* 批量插入银行账户
* @return
*/
public int batchCoscoSupplierBank(List<CoscoSupplierBank> coscoSupplierBankList);
/**
* 修改中远海运_供应商_银行账户
*

View File

@ -41,6 +41,14 @@ public interface CoscoSupplierQualificationsMapper {
*/
public int insertCoscoSupplierQualifications(CoscoSupplierQualifications coscoSupplierQualifications);
/**
* 批量插入
* @param coscoSupplierQualificationsList
* @return
*/
public int batchCoscoSupplierQualifications(List<CoscoSupplierQualifications> coscoSupplierQualificationsList);
/**
* 修改中远海运_供应商_资质信息
*

View File

@ -40,6 +40,14 @@ public interface CoscoSupplierSurveyAttachmentsMapper {
*/
public int insertCoscoSupplierSurveyAttachments(CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments);
/**
* 批量插入
* @param coscoSupplierSurveyAttachmentsList
* @return
*/
public int batchCoscoSupplierSurveyAttachments(List<CoscoSupplierSurveyAttachments> coscoSupplierSurveyAttachmentsList);
/**
* 修改中远海运_供应商_承诺书及附件
*

View File

@ -35,6 +35,13 @@ public interface CoscoSupplierSurveyQuestionReplyMapper {
*/
public int insertCoscoSupplierSurveyQuestionReply(CoscoSupplierSurveyQuestionReply coscoSupplierSurveyQuestionReply);
/**
* 批量插入
* @param coscoSupplierSurveyQuestionReplyList
* @return
*/
public int batchCoscoSupplierSurveyQuestionReply(List<CoscoSupplierSurveyQuestionReply> coscoSupplierSurveyQuestionReplyList);
/**
* 修改中远海运_供应商_社会准则符合性自查问卷_问题回复
*

View File

@ -35,5 +35,6 @@ public class CoscoMessage extends CoscoBaseEntity {
//@Excel(name = "消息类型", readConverterExp = "数=据字典")
private String type;
private String typeCn;
}

View File

@ -45,7 +45,6 @@ public class CoscoSupplierBase {
/** 企业类型(数据字典code) */
@TableField("企业类型")
@ExcelProperty("企业类型")
private String enterpriseType;
/** 企业名称 */
@ -225,6 +224,13 @@ public class CoscoSupplierBase {
@ExcelProperty("品类名称")
private String categoryName;
private List<String> deptList;
//供应商id集合
private List<String> supplierBaseList;
@ExcelProperty("企业类型")
private String enterpriseTypeCn;
//币种
private String currencyCn;
}

View File

@ -28,7 +28,7 @@ public class CoscoSupplierChangeApply extends CoscoBaseEntity {
private String changeBy;
/** 变更发起时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//@Excel(name = "变更发起时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date changeTime;
@ -77,4 +77,7 @@ public class CoscoSupplierChangeApply extends CoscoBaseEntity {
private String changeDesc;
private String deptNames;
private String enterpriseTypeCn;
}

View File

@ -63,5 +63,6 @@ public class CoscoSupplierInvoice extends CoscoBaseEntity {
//@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastUpdateTime;
private String taxpayerTypeCn;
}

View File

@ -38,7 +38,15 @@ public interface ICoscoSupplierBankService {
* @param coscoSupplierBank 中远海运_供应商_银行账户
* @return 结果
*/
public Boolean insertCoscoSupplierBank(CoscoSupplierBank coscoSupplierBank);
public int insertCoscoSupplierBank(CoscoSupplierBank coscoSupplierBank);
/**
* 批量插入
*/
public int batchCoscoSupplierBank(List<CoscoSupplierBank> coscoSupplierBankList);
/**
* 修改中远海运_供应商_银行账户

View File

@ -56,7 +56,7 @@ public interface ICoscoSupplierBaseService {
* 新增中远海运_供应商_基本信息
*
*/
public Boolean insertCoscoSupplierBase(CoscoSupplierVo vo);
public Integer insertCoscoSupplierBase(CoscoSupplierVo vo);
/**
* 修改中远海运_供应商_基本信息

View File

@ -39,7 +39,14 @@ public interface ICoscoSupplierQualificationsService {
* @param coscoSupplierQualifications 中远海运_供应商_资质信息
* @return 结果
*/
public Boolean insertCoscoSupplierQualifications(CoscoSupplierQualifications coscoSupplierQualifications);
public Integer insertCoscoSupplierQualifications(CoscoSupplierQualifications coscoSupplierQualifications);
/**
* 批量新增
*
*/
public Integer batchCoscoSupplierQualifications(List<CoscoSupplierQualifications> coscoSupplierQualifications);
/**
* 修改中远海运_供应商_资质信息

View File

@ -37,7 +37,14 @@ public interface ICoscoSupplierSurveyAttachmentsService {
* @param coscoSupplierSurveyAttachments 中远海运_供应商_承诺书及附件
* @return 结果
*/
public Boolean insertCoscoSupplierSurveyAttachments(CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments);
public int insertCoscoSupplierSurveyAttachments(CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments);
/**
* 批量插入
* @return
*/
public int batchCoscoSupplierSurveyAttachments(List<CoscoSupplierSurveyAttachments> coscoSupplierSurveyAttachmentsList);
/**
* 修改中远海运_供应商_承诺书及附件

View File

@ -35,6 +35,14 @@ public interface ICoscoSupplierSurveyQuestionReplyService {
*/
public int insertCoscoSupplierSurveyQuestionReply(CoscoSupplierSurveyQuestionReply coscoSupplierSurveyQuestionReply);
/**
* 批量插入
* @param coscoSupplierSurveyQuestionReplyList
* @return
*/
public int batchCoscoSupplierSurveyQuestionReply(List<CoscoSupplierSurveyQuestionReply> coscoSupplierSurveyQuestionReplyList);
/**
* 修改中远海运_供应商_社会准则符合性自查问卷_问题回复
*

View File

@ -111,7 +111,6 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
@Override
public IPage<CoscoAccessWork> getPage(CoscoAccessWork data) {
// 创建分页对象(当前页,每页大小)
IPage<CoscoAccessWork> page = new Page<>(data.getPageNo(), data.getPageSize());
data.setApplyType(CoscoType.APPLY_TYPE_GYSZR);
IPage<CoscoAccessWork> paegList = coscoAccessWorkMapper.selectPageList(page, data);
@ -119,7 +118,7 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
for(CoscoAccessWork coscoAccessWork : coscoAccessWorks){
CoscoAccessUser coscoAccessUser = new CoscoAccessUser();
coscoAccessUser.setAccessWorkId(coscoAccessWork.getId());
//暂时这么写,这里需要获取登录人信息
//暂时这么写,这里需要获取登录人信息,获取登录人信息验证这个人,在评审任务中是否是组长
coscoAccessUser.setUserId(data.getCreateBy());
coscoAccessUser.setIsLeader(CoscoType.IS_LEADER_SHI);
if (!CollectionUtils.isEmpty(coscoAccessUserMapper.selectCoscoAccessUserList(coscoAccessUser))) {
@ -230,7 +229,7 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
*/
@Override
public List<CoscoAccessSupplier> reviewInfoData(String id) {
//供应商信息
//通过工作任务主表id查询所有供应商信息
CoscoAccessSupplier coscoAccessSupplier = new CoscoAccessSupplier();
coscoAccessSupplier.setAccessWorkId(id);
List<CoscoAccessSupplier> supplierList = coscoAccessSupplierMapper.selectCoscoAccessSupplierList(coscoAccessSupplier);
@ -238,15 +237,15 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
CoscoAccessItem coscoAccessItem = new CoscoAccessItem();
coscoAccessItem.setAccessWorkId(id);
coscoAccessItem.setSupplierId(coscoAccessSupplier1.getSupplierId());
//查询出每个供应商的全部评审项
//通过工作任务主表id和供应商id查询出每个供应商的全部评审项
List<CoscoAccessItem> coscoAccessItemList = coscoAccessItemMapper.selectCoscoAccessItemList(coscoAccessItem);
for(CoscoAccessItem coscoAccessItem1 : coscoAccessItemList){
CoscoAccessUserItem coscoAccessUserItem = new CoscoAccessUserItem();
coscoAccessUserItem.setItemId(coscoAccessItem1.getId());
//查询评审人员
//通过评审项id查询评审人员对每个评审项的打分结果
List<CoscoAccessUserItem> coscoAccessUserItemList = coscoAccessUserItemMapper.selectCoscoAccessUserItemList(coscoAccessUserItem);
for(CoscoAccessUserItem coscoAccessUserItem1 : coscoAccessUserItemList){
//查询评审人员的附件数据
//查询评审人员打分结果的附件数据
CoscoAccessItemAttachments coscoAccessItemAttachments = new CoscoAccessItemAttachments();
coscoAccessItemAttachments.setAccessUserItemId(coscoAccessUserItem1.getId());
List<CoscoAccessItemAttachments> list = coscoAccessItemAttachmentsMapper.selectCoscoAccessItemAttachmentsList(coscoAccessItemAttachments);
@ -283,7 +282,7 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
public Boolean insertCoscoAccessWork(CoscoAccessWorkVo vo) {
String workId = CoscoIdUtil.getId();//工作主体id
Date date = CoscoDateUtils.getNowDate();
//任务主体新增/供应商准入
//供应商准入_准入申请工作主表新增
CoscoAccessWork coscoAccessWork = vo.getCoscoAccessWork();
coscoAccessWork.setId(workId);
coscoAccessWork.setApplyType(CoscoType.APPLY_TYPE_GYSZR);
@ -302,20 +301,25 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
coscoAccessWork.setLastUpdateTime(date);
coscoAccessWorkMapper.insertCoscoAccessWork(coscoAccessWork);
//供应商准入_准入申请关联品类表新增
addCateGoryId(vo, workId);
//供应商准入_关联供应商表新增
addSupplierIds(vo, workId, coscoAccessWork);
//如果是线上准入、有人员和评审项
//如果是线上准入、则需要添加评审人员和评审项
if(CoscoType.ACCESS_TYPE_ONLINE.equals(coscoAccessWork.getAccessType())){
List<CoscoAccessUser> coscoAccessUserls = vo.getCoscoAccessUserls();
//添加评审人员并返回组长id
String zuZhangId = addCoscoAccessUser(workId, coscoAccessUserls);//组长id
//给每个供应商添加评审项,并且把每个供应商的评审项进行人员绑定,组长需要每一个家供应商添加一项结果汇总
addUserAndItem(vo, workId, zuZhangId);
//给各个评审人员发送消息
//给各个评审人员发送消息,告知有新的供应商需要评审
coscoMessageService.userMessage(coscoAccessUserls);
}
//如果是线下准入
//如果是线下准入,需要上传审查附件,不需要走评审流程
if(CoscoType.ACCESS_TYPE_OFFLINE.equals(coscoAccessWork.getAccessType())){
CoscoAccessWorkAttachments coscoAccessWorkAttachments = vo.getCoscoAccessWorkAttachments();
coscoAccessWorkAttachments.setAccessWorkId(workId);
@ -575,6 +579,7 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
throw new IllegalArgumentException("任务信息不能为空");
}
//验证当前工作任务是否已经处理完成
if(CoscoType.APPROVE_STATUS_TG.equals(coscoAccessWorkData.getApproveStatus()) ||
CoscoType.APPROVE_STATUS_BH.equals(coscoAccessWorkData.getApproveStatus()) ){
throw new IllegalArgumentException("该任务已处理完成");
@ -591,14 +596,14 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
updateWork(coscoAccessWork);//可能审批回调没有登录人信息
//供应商信息
//通过工作主体任务id查询供应商信息
CoscoAccessSupplier coscoAccessSupplier = new CoscoAccessSupplier();
coscoAccessSupplier.setAccessWorkId(vo.getId());
List<CoscoAccessSupplier> supplierList = coscoAccessSupplierMapper.selectCoscoAccessSupplierList(coscoAccessSupplier);
//审批通过
//如果审批通过,把
if(CoscoType.APPROVE_STATUS_TG.equals(vo.getApproveStatus())){

View File

@ -63,7 +63,7 @@ public class CoscoSupplierBankServiceImpl implements ICoscoSupplierBankService {
* @return 结果
*/
@Override
public Boolean insertCoscoSupplierBank(CoscoSupplierBank coscoSupplierBank) {
public int insertCoscoSupplierBank(CoscoSupplierBank coscoSupplierBank) {
Date date = CoscoDateUtils.getNowDate();
coscoSupplierBank.setId(CoscoIdUtil.getId());
coscoSupplierBank.setCreateBy("1");
@ -71,8 +71,13 @@ public class CoscoSupplierBankServiceImpl implements ICoscoSupplierBankService {
coscoSupplierBank.setUpdateBy("1");
coscoSupplierBank.setUpdateTime(date);
coscoSupplierBank.setLastUpdateTime(date);
coscoSupplierBankMapper.insertCoscoSupplierBank(coscoSupplierBank);
return true;
return coscoSupplierBankMapper.insertCoscoSupplierBank(coscoSupplierBank);
}
@Override
public int batchCoscoSupplierBank(List<CoscoSupplierBank> coscoSupplierBankList) {
return coscoSupplierBankMapper.batchCoscoSupplierBank(coscoSupplierBankList);
}
/**

View File

@ -37,8 +37,7 @@ public class CoscoSupplierBaseServiceImpl implements ICoscoSupplierBaseService {
@Autowired
private CoscoSupplierQualificationsMapper coscoSupplierQualificationsMapper;
@Autowired
private ICoscoSupplierQualificationsService coscoSupplierQualificationsService;
@Autowired
private CoscoAccessSupplierMapper coscoAccessSupplierMapper;
@ -48,32 +47,29 @@ public class CoscoSupplierBaseServiceImpl implements ICoscoSupplierBaseService {
@Autowired
private CoscoSupplierInvoiceMapper coscoSupplierInvoiceMapper;
@Autowired
private ICoscoSupplierInvoiceService coscoSupplierInvoiceService;
@Autowired
private CoscoSupplierBankMapper coscoSupplierBankMapper;
@Autowired
private ICoscoSupplierBankService coscoSupplierBankService;
private CoscoSupplierSurveyMapper coscoSupplierSurveyMapper;
@Autowired
private ICoscoSupplierSurveyService coscoSupplierSurveyService;
@Autowired
private ICoscoSupplierSurveyQuestionReplyService coscoSupplierSurveyQuestionReplyService;
private CoscoSupplierSurveyQuestionReplyMapper coscoSupplierSurveyQuestionReplyMapper;
@Autowired
private CoscoSupplierSurveyAttachmentsMapper coscoSupplierSurveyAttachmentsMapper;
@Autowired
private ICoscoSupplierSurveyAttachmentsService coscoSupplierSurveyAttachmentsService;
@ -92,11 +88,12 @@ public class CoscoSupplierBaseServiceImpl implements ICoscoSupplierBaseService {
@Override
public IPage<CoscoSupplierBase> selectWzrPageList(CoscoSupplierBase coscoSupplierBase) {
//查询当前登录人的部门本级、上级、下级所有已发起和已准入供应商id
List<String> deptIds = new ArrayList<>();
deptIds.add("DEPT001");
List<String> deptList = coscoAccessSupplierMapper.selectSupplierIdByDeptIdList(deptIds);
coscoSupplierBase.setDeptList(deptList);
// 创建分页对象(当前页,每页大小)
List<String> supplierBaseList = coscoAccessSupplierMapper.selectSupplierIdByDeptIdList(deptIds);
coscoSupplierBase.setSupplierBaseList(supplierBaseList);
//查询当前登录人的部门本级、上级、下级,以外的供应商数据
IPage<CoscoSupplierBase> page = new Page<>(coscoSupplierBase.getPageNo(), coscoSupplierBase.getPageSize());
return coscoSupplierBaseMapper.selectWzrPageList(page, coscoSupplierBase);
}
@ -186,63 +183,102 @@ public class CoscoSupplierBaseServiceImpl implements ICoscoSupplierBaseService {
*/
@Override
@Transactional
public Boolean insertCoscoSupplierBase(CoscoSupplierVo vo) {
String supplierId = CoscoIdUtil.getId();//企业id
public Integer insertCoscoSupplierBase(CoscoSupplierVo vo) {
String supplierId = CoscoIdUtil.getId();//供应商id
Date date = new Date();
//基本信息新增
if (!ObjectUtils.isEmpty(vo.getCoscoSupplierBase())) {
CoscoSupplierBase coscoSupplierBase = vo.getCoscoSupplierBase();
coscoSupplierBase.setId(supplierId);
coscoSupplierBase.setCreateBy("1");
coscoSupplierBase.setCreateTime(date);
coscoSupplierBase.setUpdateBy("1");
coscoSupplierBase.setUpdateTime(date);
coscoSupplierBase.setLastUpdateTime(date);
coscoSupplierBaseMapper.insertCoscoSupplierBase(coscoSupplierBase);
//资质信息集合
List<CoscoSupplierQualifications> coscoSupplierQualificationsList = new ArrayList<>();
//银行账户集合
List<CoscoSupplierBank> coscoSupplierBankList = new ArrayList<>();
//问题回复集合
List<CoscoSupplierSurveyQuestionReply> coscoSupplierSurveyQuestionReplieList = new ArrayList<>();
//承诺书附件集合
List<CoscoSupplierSurveyAttachments> coscoSupplierSurveyAttachmentsList = new ArrayList<>();
}
//资质信息新增
if (!CollectionUtils.isEmpty(vo.getCoscoSupplierQualifications())) {
for(CoscoSupplierQualifications coscoSupplierQualifications : vo.getCoscoSupplierQualifications()){
coscoSupplierQualifications.setSupplierId(supplierId);
coscoSupplierQualificationsService.insertCoscoSupplierQualifications(coscoSupplierQualifications);
coscoSupplierQualifications.setId(CoscoIdUtil.getId());
coscoSupplierQualifications.setCreateBy("1");
coscoSupplierQualifications.setCreateTime(date);
coscoSupplierQualifications.setUpdateBy("1");
coscoSupplierQualifications.setUpdateTime(date);
coscoSupplierQualifications.setLastUpdateTime(date);
coscoSupplierQualificationsList.add(coscoSupplierQualifications);
}
}
//发票信息
//发票信息保存
if (!ObjectUtils.isEmpty(vo.getCoscoSupplierInvoice())) {
CoscoSupplierInvoice coscoSupplierInvoice = vo.getCoscoSupplierInvoice();
coscoSupplierInvoice.setSupplierId(supplierId);
coscoSupplierInvoiceService.insertCoscoSupplierInvoice(coscoSupplierInvoice);
coscoSupplierInvoiceMapper.insertCoscoSupplierInvoice(coscoSupplierInvoice);
}
//银行
if (!CollectionUtils.isEmpty(vo.getCoscoSupplierBank())) {
for(CoscoSupplierBank coscoSupplierBank : vo.getCoscoSupplierBank()){
coscoSupplierBank.setSupplierId(supplierId);
coscoSupplierBankService.insertCoscoSupplierBank(coscoSupplierBank);
coscoSupplierBank.setId(CoscoIdUtil.getId());
coscoSupplierBank.setCreateBy("1");
coscoSupplierBank.setCreateTime(date);
coscoSupplierBank.setUpdateBy("1");
coscoSupplierBank.setUpdateTime(date);
coscoSupplierBank.setLastUpdateTime(date);
coscoSupplierBankList.add(coscoSupplierBank);
}
}
if (!ObjectUtils.isEmpty(vo.getCoscoSupplierSurvey())) {
//填写人信息
CoscoSupplierSurvey coscoSupplierSurvey = vo.getCoscoSupplierSurvey();
coscoSupplierSurvey.setSupplierId(supplierId);
coscoSupplierSurveyService.insertCoscoSupplierSurvey(coscoSupplierSurvey);
coscoSupplierSurveyMapper.insertCoscoSupplierSurvey(coscoSupplierSurvey);
}
//问题回复
if (!CollectionUtils.isEmpty(vo.getCoscoSupplierSurveyQuestionReply())) {
for(CoscoSupplierSurveyQuestionReply coscoSupplierSurveyQuestionReply : vo.getCoscoSupplierSurveyQuestionReply()){
coscoSupplierSurveyQuestionReply.setSupplierId(supplierId);
coscoSupplierSurveyQuestionReplyService.insertCoscoSupplierSurveyQuestionReply(coscoSupplierSurveyQuestionReply);
coscoSupplierSurveyQuestionReply.setId(CoscoIdUtil.getId());
coscoSupplierSurveyQuestionReply.setCreateBy("1");
coscoSupplierSurveyQuestionReply.setCreateTime(date);
coscoSupplierSurveyQuestionReply.setUpdateBy("1");
coscoSupplierSurveyQuestionReply.setUpdateTime(date);
coscoSupplierSurveyQuestionReply.setLastUpdateTime(date);
coscoSupplierSurveyQuestionReplieList.add(coscoSupplierSurveyQuestionReply);
}
}
//承诺书/其他附件
if (!CollectionUtils.isEmpty(vo.getCoscoSupplierSurveyAttachments())) {
for(CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments : vo.getCoscoSupplierSurveyAttachments()){
coscoSupplierSurveyAttachments.setSupplierId(supplierId);
coscoSupplierSurveyAttachmentsService.insertCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachments);
coscoSupplierSurveyAttachments.setId(CoscoIdUtil.getId());
coscoSupplierSurveyAttachments.setCreateBy("1");
coscoSupplierSurveyAttachments.setCreateTime(date);
coscoSupplierSurveyAttachments.setUpdateBy("1");
coscoSupplierSurveyAttachments.setUpdateTime(date);
coscoSupplierSurveyAttachments.setLastUpdateTime(date);
coscoSupplierSurveyAttachmentsList.add(coscoSupplierSurveyAttachments);
}
}
return true;
//资质信息保存
coscoSupplierQualificationsMapper.batchCoscoSupplierQualifications(coscoSupplierQualificationsList);
//银行账户保存
coscoSupplierBankMapper.batchCoscoSupplierBank(coscoSupplierBankList);
//问题回复保存
coscoSupplierSurveyQuestionReplyMapper.batchCoscoSupplierSurveyQuestionReply(coscoSupplierSurveyQuestionReplieList);
//承诺书、其他附件保存
coscoSupplierSurveyAttachmentsMapper.batchCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachmentsList);
//基本信息新增
CoscoSupplierBase coscoSupplierBase = vo.getCoscoSupplierBase();
coscoSupplierBase.setId(supplierId);
coscoSupplierBase.setCreateBy("1");
coscoSupplierBase.setCreateTime(date);
coscoSupplierBase.setUpdateBy("1");
coscoSupplierBase.setUpdateTime(date);
coscoSupplierBase.setLastUpdateTime(date);
return coscoSupplierBaseMapper.insertCoscoSupplierBase(coscoSupplierBase);
}
/**

View File

@ -60,7 +60,7 @@ public class CoscoSupplierQualificationsServiceImpl implements ICoscoSupplierQua
* @return 结果
*/
@Override
public Boolean insertCoscoSupplierQualifications(CoscoSupplierQualifications coscoSupplierQualifications) {
public Integer insertCoscoSupplierQualifications(CoscoSupplierQualifications coscoSupplierQualifications) {
Date date = CoscoDateUtils.getNowDate();
coscoSupplierQualifications.setId(CoscoIdUtil.getId());
coscoSupplierQualifications.setCreateBy("1");
@ -68,10 +68,21 @@ public class CoscoSupplierQualificationsServiceImpl implements ICoscoSupplierQua
coscoSupplierQualifications.setUpdateBy("1");
coscoSupplierQualifications.setUpdateTime(date);
coscoSupplierQualifications.setLastUpdateTime(date);
coscoSupplierQualificationsMapper.insertCoscoSupplierQualifications(coscoSupplierQualifications);
return true;
return coscoSupplierQualificationsMapper.insertCoscoSupplierQualifications(coscoSupplierQualifications);
}
/**
* 批量插入资质信息
* @param coscoSupplierQualificationsList
* @return
*/
@Override
public Integer batchCoscoSupplierQualifications(List<CoscoSupplierQualifications> coscoSupplierQualificationsList) {
return coscoSupplierQualificationsMapper.batchCoscoSupplierQualifications(coscoSupplierQualificationsList);
}
/**
* 修改中远海运_供应商_资质信息
*

View File

@ -10,6 +10,7 @@ import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoSupplierSu
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
@ -59,15 +60,25 @@ public class CoscoSupplierSurveyAttachmentsServiceImpl implements ICoscoSupplier
* @return 结果
*/
@Override
public Boolean insertCoscoSupplierSurveyAttachments(CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments) {
public int insertCoscoSupplierSurveyAttachments(CoscoSupplierSurveyAttachments coscoSupplierSurveyAttachments) {
Date date = new Date();
coscoSupplierSurveyAttachments.setId(CoscoIdUtil.getId());
coscoSupplierSurveyAttachments.setCreateBy("1");
coscoSupplierSurveyAttachments.setCreateTime(CoscoDateUtils.getNowDate());
coscoSupplierSurveyAttachments.setCreateTime(date);
coscoSupplierSurveyAttachments.setUpdateBy("1");
coscoSupplierSurveyAttachments.setUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierSurveyAttachments.setLastUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierSurveyAttachmentsMapper.insertCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachments);
return true;
coscoSupplierSurveyAttachments.setUpdateTime(date);
coscoSupplierSurveyAttachments.setLastUpdateTime(date);
return coscoSupplierSurveyAttachmentsMapper.insertCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachments);
}
/**
* 批量插入
* @param coscoSupplierSurveyAttachmentsList
* @return
*/
@Override
public int batchCoscoSupplierSurveyAttachments(List<CoscoSupplierSurveyAttachments> coscoSupplierSurveyAttachmentsList) {
return coscoSupplierSurveyAttachmentsMapper.batchCoscoSupplierSurveyAttachments(coscoSupplierSurveyAttachmentsList);
}
/**

View File

@ -62,6 +62,11 @@ public class CoscoSupplierSurveyQuestionReplyServiceImpl implements ICoscoSuppli
return coscoSupplierSurveyQuestionReplyMapper.insertCoscoSupplierSurveyQuestionReply(coscoSupplierSurveyQuestionReply);
}
@Override
public int batchCoscoSupplierSurveyQuestionReply(List<CoscoSupplierSurveyQuestionReply> coscoSupplierSurveyQuestionReplyList) {
return coscoSupplierSurveyQuestionReplyMapper.batchCoscoSupplierSurveyQuestionReply(coscoSupplierSurveyQuestionReplyList);
}
/**
* 修改中远海运_供应商_社会准则符合性自查问卷_问题回复
*

View File

@ -67,6 +67,17 @@
WHERE
cas.supplier_id = #{vo.supplierId}
AND cas.access_status IN (1,2)
<if test="vo.categoryNames != null and vo.categoryNames != ''">
AND (
SELECT
(SELECT GROUP_CONCAT(category_name ORDER BY FIND_IN_SET(id, c.ancestors) SEPARATOR '-')
FROM cosco_category
WHERE FIND_IN_SET(id, c.ancestors)
) AS ancestor_names
FROM cosco_category c
WHERE id = casc.category_id
) like concat('%', #{vo.categoryNames}, '%')
</if>
GROUP BY
caw.update_time,
cas.dept_id,

View File

@ -21,10 +21,12 @@
m.content,
m.`read`,
m.type,
dp.dic_name as typeCn,
m.create_time,
m.update_time
FROM
cosco_message m
left join dict_project dp on m.type = dp.`code` and dp.parent_code = 'message_type'
</sql>
<select id="selectCoscoMessageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoMessage" resultMap="CoscoMessageResult">

View File

@ -130,10 +130,10 @@
</insert>
<insert id="batchCoscoSupplierBank" parameterType="java.util.List">
insert into cosco_supplier_bank
( id, supplier_id, interbank_number, bank, swift_code, account_name, account, currency, nation, province, city, del_flag, create_by, create_time, update_by, update_time, last_update_time)
( id, supplier_id, interbank_number, bank, swift_code, account_name, account, currency, nation, province, city, create_by, create_time, update_by, update_time, last_update_time)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.supplierId}, #{item.interbankNumber}, #{item.bank}, #{item.swiftCode}, #{item.accountName}, #{item.account}, #{item.currency}, #{item.nation}, #{item.province}, #{item.city}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
( #{item.id}, #{item.supplierId}, #{item.interbankNumber}, #{item.bank}, #{item.swiftCode}, #{item.accountName}, #{item.account}, #{item.currency}, #{item.nation}, #{item.province}, #{item.city}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
</foreach>
</insert>
<update id="updateCoscoSupplierBank" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBank">

View File

@ -48,13 +48,15 @@
<result property="lastUpdateTime" column="last_update_time"/>
<result property="supplierTypeCn" column="supplier_type_cn"/>
<result property="accessStatusCn" column="access_status_cn"/>
<result property="enterpriseTypeCn" column="enterprise_type_cn"/>
<result property="currencyCn" column="currency_cn"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectCoscoSupplierBaseVo">
SELECT
id,
csb.id,
dept_id,
supplier_type,
CASE supplier_type
@ -66,6 +68,7 @@
licence_accessory,
licence_date,
enterprise_type,
dp.dic_name as enterprise_type_cn,
name,
name_en,
social_credit_code,
@ -85,6 +88,7 @@
vat,
taxpayer_id,
currency,
dpbz.dic_name as currency_cn,
person_name,
person_phone,
person_bank,
@ -122,7 +126,9 @@
update_time,
last_update_time
FROM
cosco_supplier_base
cosco_supplier_base csb
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
left join dict_project dpbz on csb.currency = dpbz.`code` and dpbz.parent_code = 'currency'
</sql>
@ -135,6 +141,7 @@
WHEN 'pe' THEN '个人'
END AS supplier_type_cn,
csb.enterprise_type,
dp.dic_name as enterprise_type_cn,
cas.id,
cas.access_work_id,
cas.supplier_id,
@ -152,6 +159,7 @@
LEFT JOIN cosco_supplier_base csb ON cas.supplier_id = csb.id
left join cosco_access_supplier_category casc on csb.id = casc.supplier_id and casc.del_flag = 'normal'
left join cosco_category cc on casc.category_id = cc.id and cc.del_flag = 'normal'
left join dict_project dp on csb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
</sql>
@ -161,9 +169,9 @@
WHERE 1=1
<!-- 假设参数是 List<String> list -->
<if test="vo.deptList != null and vo.deptList.size() > 0">
AND id NOT IN
<foreach collection="vo.deptList" item="item" open="(" separator="," close=")">
<if test="vo.supplierBaseList != null and vo.supplierBaseList.size() > 0">
AND csb.id NOT IN
<foreach collection="vo.supplierBaseList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
@ -420,7 +428,7 @@
and csb.social_credit_code = #{vo.socialCreditCode}
</if>
<if test="vo.accessStatus != null ">
and csb.access_status = #{vo.accessStatus}
and cas.access_status = #{vo.accessStatus}
</if>
<if test="vo.blacklistStatus != null ">
and csb.blacklist_status = #{vo.blacklistStatus}
@ -447,7 +455,8 @@
cas.supplier_id,
csb.`name`,
caw.update_time ,
csb.enterprise_type
csb.enterprise_type,
dp.dic_name
order by csb.create_time desc
</select>
@ -507,7 +516,8 @@
cas.supplier_id,
csb.`name`,
caw.update_time ,
csb.enterprise_type
csb.enterprise_type,
dp.dic_name
order by csb.create_time desc
</select>
@ -627,7 +637,7 @@
<select id="selectCoscoSupplierBaseById" parameterType="String"
resultMap="CoscoSupplierBaseResult">
<include refid="selectCoscoSupplierBaseVo"/>
where id = #{id}
where csb.id = #{id}
</select>
<insert id="insertCoscoSupplierBase"

View File

@ -24,6 +24,9 @@
<result property="enterpriseType" column="enterprise_type"/>
<result property="title" column="title"/>
<result property="changeDesc" column="change_desc"/>
<result property="enterpriseTypeCn" column="enterprise_type_cn"/>
</resultMap>
<sql id="selectCoscoSupplierChangeApplyVo">
@ -97,13 +100,14 @@
END AS supplier_type,
sb.`name` AS supplierName,
sb.enterprise_type,
dp.dic_name as enterprise_type_cn,
c.change_by,
c.change_time,
c.approve_status,
CASE
WHEN c.approve_status = 0 THEN
'审批'
'审批'
WHEN c.approve_status = 1 THEN
'通过'
WHEN c.approve_status = 2 THEN
@ -116,6 +120,7 @@
FROM
cosco_supplier_change_apply c
LEFT JOIN cosco_supplier_base sb ON c.supplier_id = sb.id
left join dict_project dp on sb.enterprise_type = dp.`code` and dp.parent_code = 'enterprise_type'
left join (
SELECT
cas.supplier_id,

View File

@ -21,11 +21,31 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="lastUpdateTime" column="last_update_time"/>
<result property="taxpayerTypeCn" column="taxpayer_type_cn"/>
</resultMap>
<sql id="selectCoscoSupplierInvoiceVo">
select id, supplier_id, taxpayer_type, taxpayer_code, phone, account, head, address, bank, qualification_certificate, del_flag, create_by, create_time, update_by, update_time, last_update_time
from cosco_supplier_invoice
SELECT
csi.id,
supplier_id,
taxpayer_type,
dp.dic_name as taxpayer_type_cn,
taxpayer_code,
phone,
account,
head,
address,
bank,
qualification_certificate,
del_flag,
create_by,
create_time,
update_by,
update_time,
last_update_time
FROM
cosco_supplier_invoice csi
left join dict_project dp on csi.taxpayer_type = dp.`code` and dp.parent_code = 'taxpayer_type'
</sql>
@ -107,7 +127,7 @@
<select id="selectCoscoSupplierInvoiceById" parameterType="String"
resultMap="CoscoSupplierInvoiceResult">
<include refid="selectCoscoSupplierInvoiceVo"/>
where id = #{id}
where csi.id = #{id}
</select>
<insert id="insertCoscoSupplierInvoice" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierInvoice">

View File

@ -152,10 +152,10 @@
</insert>
<insert id="batchCoscoSupplierQualifications" parameterType="java.util.List">
insert into cosco_supplier_qualifications
( id, supplier_id, certificate_type, name, code, type_level, authority, date_time, term_of_validity, accessory, del_flag, create_by, create_time, update_by, update_time, last_update_time)
( id, supplier_id, certificate_type, name, code, type_level, authority, date_time, term_of_validity, accessory, create_by, create_time, update_by, update_time, last_update_time)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.supplierId}, #{item.certificateType}, #{item.name}, #{item.code}, #{item.typeLevel}, #{item.authority}, #{item.dateTime}, #{item.termOfValidity}, #{item.accessory}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
( #{item.id}, #{item.supplierId}, #{item.certificateType}, #{item.name}, #{item.code}, #{item.typeLevel}, #{item.authority}, #{item.dateTime}, #{item.termOfValidity}, #{item.accessory}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
</foreach>
</insert>
<update id="updateCoscoSupplierQualifications" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierQualifications">

View File

@ -155,10 +155,10 @@
</insert>
<insert id="batchCoscoSupplierSurveyAttachments" parameterType="java.util.List">
insert into cosco_supplier_survey_attachments
( id, supplier_id, attachments_type, file_name, file_type, file_size, file_path, file_url, del_flag, create_by, create_time, update_by, update_time, last_update_time)
( id, supplier_id, attachments_type, file_name, file_type, file_size, file_path, file_url, create_by, create_time, update_by, update_time, last_update_time)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.supplierId}, #{item.attachmentsType}, #{item.fileName}, #{item.fileType}, #{item.fileSize}, #{item.filePath}, #{item.fileUrl}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
( #{item.id}, #{item.supplierId}, #{item.attachmentsType}, #{item.fileName}, #{item.fileType}, #{item.fileSize}, #{item.filePath}, #{item.fileUrl}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
</foreach>
</insert>
<update id="updateCoscoSupplierSurveyAttachments" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyAttachments">

View File

@ -75,10 +75,10 @@
</insert>
<insert id="batchCoscoSupplierSurveyQuestionReply" parameterType="java.util.List">
insert into cosco_supplier_survey_question_reply
( id, supplier_id, survey_question_id, reply_value, del_flag, create_by, create_time, update_by, update_time, last_update_time)
( id, supplier_id, survey_question_id, reply_value, create_by, create_time, update_by, update_time, last_update_time)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.supplierId}, #{item.surveyQuestionId}, #{item.replyValue}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
( #{item.id}, #{item.supplierId}, #{item.surveyQuestionId}, #{item.replyValue}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
</foreach>
</insert>
<update id="updateCoscoSupplierSurveyQuestionReply" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierSurveyQuestionReply">