供应商列表

This commit is contained in:
sxu 2025-04-01 13:09:23 +08:00
parent a305147524
commit 07875a6089
6 changed files with 734 additions and 124 deletions

View File

@ -5,6 +5,8 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.canteen.core.drp.api.DrpAuthorityApi;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierEditDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierEditStatusDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.service.DrpSupplierService;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
@ -65,35 +67,27 @@ public class DrpSupplierController {
}
}
// @RequiresPermissions({"drp:supplier:update"})
// @PostMapping({"/edit"})
// @RequiresAuthentication
// @ApiOperation("修改供应商信息")
// public LeResponse<?> editDrpSupplier(@RequestBody @Valid LeRequest<DrpSupplierEditDTO> leRequest) {
// DrpSupplierEditDTO content = (DrpSupplierEditDTO)leRequest.getContent();
// this.drpSupplierService.editDrpSupplier(content);
// return LeResponse.succ();
// }
//
// @PostMapping({"/remove/{supplierId}"})
// @RequiresGuest
// @ApiOperation("删除供应商信息")
// @RequiresPermissions({"drp:supplier:delete"})
// public LeResponse<?> removeBySupplierId(@PathVariable Long supplierId) {
// this.drpSupplierService.removeBySupplierId(supplierId);
// return LeResponse.succ();
// }
//
// @RequiresPermissions({"drp:supplier:status"})
// @PostMapping({"/edit/status"})
// @RequiresAuthentication
// @ApiOperation("变更供应商状态")
// public LeResponse<?> editDrpSupplierStatus(@RequestBody @Valid LeRequest<DrpSupplierEditStatusDTO> leRequest) {
// DrpSupplierEditStatusDTO content = (DrpSupplierEditStatusDTO)leRequest.getContent();
// this.drpSupplierService.editDrpSupplierStatus(content);
// return LeResponse.succ();
// }
//
@PostMapping({"/edit"})
@ApiOperation("修改供应商信息")
public AjaxResult editDrpSupplier(@RequestBody @Valid DrpSupplierEditDTO dto) {
this.drpSupplierService.editDrpSupplier(dto);
return AjaxResult.success();
}
@PostMapping({"/remove/{supplierId}"})
@ApiOperation("删除供应商信息")
public AjaxResult removeBySupplierId(@PathVariable Long supplierId) {
this.drpSupplierService.removeBySupplierId(supplierId);
return AjaxResult.success();
}
@PostMapping({"/edit/status"})
@ApiOperation("变更供应商状态")
public AjaxResult editDrpSupplierStatus(@RequestBody @Valid DrpSupplierEditStatusDTO dto) {
this.drpSupplierService.editDrpSupplierStatus(dto);
return AjaxResult.success();
}
// @PostMapping({"/list/supplier"})
// @RequiresAuthentication
// @ApiOperation("查询供应商集合")

View File

@ -0,0 +1,479 @@
package com.bonus.canteen.core.drp.dto;
import com.bonus.canteen.core.common.utils.SysUtil;
import com.bonus.canteen.core.drp.vo.DrpContractAttachmentDTO;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
public class DrpSupplierEditDTO {
@ApiModelProperty("供应商id")
private @NotNull(
message = "供应商id不能为空 ^_^"
) Long supplierId;
@ApiModelProperty("区域Id")
private @NotNull(
message = "区域Id不能为空!"
) Long areaId;
@ApiModelProperty("供应商名称")
private @NotBlank(
message = "供应商名称不能为空!"
) String supplierName;
@ApiModelProperty("详细地址")
private String address;
@ApiModelProperty("主要联系人")
private String linkman;
@ApiModelProperty("主要联系人电话")
private String linkmanNumber;
@ApiModelProperty("主要邮箱")
private String email;
@ApiModelProperty("主要微信号")
private String wechat;
@ApiModelProperty("开户行")
private String openingBank;
@ApiModelProperty("银行账号")
private String bankAccount;
@ApiModelProperty("供应商简称")
private String supplierSimpleName;
@ApiModelProperty("供应商电话")
private String telephone;
@ApiModelProperty("公司网站")
private String companyWeb;
@ApiModelProperty("区域-省")
private String regionProvince;
@ApiModelProperty("区域-市")
private String regionCity;
@ApiModelProperty("区域-区")
private String regionDistrict;
@ApiModelProperty("税率(1=3,2=6,3=13)%")
private Integer taxRate;
@ApiModelProperty("账期1日2周3月4两个月5季度6半年7年")
private Integer paymentDays;
@ApiModelProperty("备用联系人")
private String standbyLinkman;
@ApiModelProperty("备用手机号")
private String standbyPhone;
@ApiModelProperty("备用微信")
private String standbyWechat;
@ApiModelProperty("备用邮箱")
private String standbyEmail;
@ApiModelProperty("供应类目")
private List<Long> categoryIdList;
@ApiModelProperty("注册资金(万元)")
private BigDecimal registFund;
@ApiModelProperty("成立时间")
private LocalDate establishDate;
@ApiModelProperty("职工人数")
private Integer workersNum;
@ApiModelProperty("目前服务的客户数量")
private Integer clientNum;
@ApiModelProperty("去年营业收入(万元)")
private BigDecimal lastYearOperatingIncome;
@ApiModelProperty("前年营业收入(万元)")
private BigDecimal beforeYearOperatingIncome;
@ApiModelProperty("经营范围(工商信息)")
private String businessScope;
@ApiModelProperty("前五大客户")
private String topFiveClient;
@ApiModelProperty("前五大供应商")
private String topFiveSupplier;
@ApiModelProperty("公司简介")
private String companyIntroduction;
@ApiModelProperty("主要优势")
private String mainAdvantage;
@ApiModelProperty("是否接收通知(1是2否)")
private Integer ifReceiveNotice;
@ApiModelProperty("流程通知方式(1不通知2短信3公众号)")
private Integer noticeStyle;
@ApiModelProperty("供应商用户id")
private Long supplierUserId;
@ApiModelProperty("供应商状态(1-待审核,2-审核通过,3-禁用)")
private Integer status;
@ApiModelProperty("资质集合")
@Size(
min = 1,
message = "主要资质不能为空"
) List<DrpSupplierQualificationUpdateDTO> mainQualificationList;
@ApiModelProperty("送货人集合")
private List<DrpSupplierDeliverAddDTO> deliverVOList;
@ApiModelProperty("资质集合")
List<DrpSupplierQualificationSaveDTO> otherQualificationList;
@ApiModelProperty("身份证正")
private String idCardImgZ;
@ApiModelProperty("身份证反")
private String idCardImgF;
@ApiModelProperty("附件")
private List<DrpContractAttachmentDTO> attachmentList;
@ApiModelProperty("备注")
private String remark;
public void setIdCardImgZ(String idCardImgZ) {
this.idCardImgZ = SysUtil.getCutPath(idCardImgZ);
}
public void setIdCardImgF(String idCardImgF) {
this.idCardImgF = SysUtil.getCutPath(idCardImgF);
}
public Long getSupplierId() {
return this.supplierId;
}
public Long getAreaId() {
return this.areaId;
}
public String getSupplierName() {
return this.supplierName;
}
public String getAddress() {
return this.address;
}
public String getLinkman() {
return this.linkman;
}
public String getLinkmanNumber() {
return this.linkmanNumber;
}
public String getEmail() {
return this.email;
}
public String getWechat() {
return this.wechat;
}
public String getOpeningBank() {
return this.openingBank;
}
public String getBankAccount() {
return this.bankAccount;
}
public String getSupplierSimpleName() {
return this.supplierSimpleName;
}
public String getTelephone() {
return this.telephone;
}
public String getCompanyWeb() {
return this.companyWeb;
}
public String getRegionProvince() {
return this.regionProvince;
}
public String getRegionCity() {
return this.regionCity;
}
public String getRegionDistrict() {
return this.regionDistrict;
}
public Integer getTaxRate() {
return this.taxRate;
}
public Integer getPaymentDays() {
return this.paymentDays;
}
public String getStandbyLinkman() {
return this.standbyLinkman;
}
public String getStandbyPhone() {
return this.standbyPhone;
}
public String getStandbyWechat() {
return this.standbyWechat;
}
public String getStandbyEmail() {
return this.standbyEmail;
}
public List<Long> getCategoryIdList() {
return this.categoryIdList;
}
public BigDecimal getRegistFund() {
return this.registFund;
}
public LocalDate getEstablishDate() {
return this.establishDate;
}
public Integer getWorkersNum() {
return this.workersNum;
}
public Integer getClientNum() {
return this.clientNum;
}
public BigDecimal getLastYearOperatingIncome() {
return this.lastYearOperatingIncome;
}
public BigDecimal getBeforeYearOperatingIncome() {
return this.beforeYearOperatingIncome;
}
public String getBusinessScope() {
return this.businessScope;
}
public String getTopFiveClient() {
return this.topFiveClient;
}
public String getTopFiveSupplier() {
return this.topFiveSupplier;
}
public String getCompanyIntroduction() {
return this.companyIntroduction;
}
public String getMainAdvantage() {
return this.mainAdvantage;
}
public Integer getIfReceiveNotice() {
return this.ifReceiveNotice;
}
public Integer getNoticeStyle() {
return this.noticeStyle;
}
public Long getSupplierUserId() {
return this.supplierUserId;
}
public Integer getStatus() {
return this.status;
}
public List<DrpSupplierQualificationUpdateDTO> getMainQualificationList() {
return this.mainQualificationList;
}
public List<DrpSupplierDeliverAddDTO> getDeliverVOList() {
return this.deliverVOList;
}
public List<DrpSupplierQualificationSaveDTO> getOtherQualificationList() {
return this.otherQualificationList;
}
public String getIdCardImgZ() {
return this.idCardImgZ;
}
public String getIdCardImgF() {
return this.idCardImgF;
}
public List<DrpContractAttachmentDTO> getAttachmentList() {
return this.attachmentList;
}
public String getRemark() {
return this.remark;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setAreaId(final Long areaId) {
this.areaId = areaId;
}
public void setSupplierName(final String supplierName) {
this.supplierName = supplierName;
}
public void setAddress(final String address) {
this.address = address;
}
public void setLinkman(final String linkman) {
this.linkman = linkman;
}
public void setLinkmanNumber(final String linkmanNumber) {
this.linkmanNumber = linkmanNumber;
}
public void setEmail(final String email) {
this.email = email;
}
public void setWechat(final String wechat) {
this.wechat = wechat;
}
public void setOpeningBank(final String openingBank) {
this.openingBank = openingBank;
}
public void setBankAccount(final String bankAccount) {
this.bankAccount = bankAccount;
}
public void setSupplierSimpleName(final String supplierSimpleName) {
this.supplierSimpleName = supplierSimpleName;
}
public void setTelephone(final String telephone) {
this.telephone = telephone;
}
public void setCompanyWeb(final String companyWeb) {
this.companyWeb = companyWeb;
}
public void setRegionProvince(final String regionProvince) {
this.regionProvince = regionProvince;
}
public void setRegionCity(final String regionCity) {
this.regionCity = regionCity;
}
public void setRegionDistrict(final String regionDistrict) {
this.regionDistrict = regionDistrict;
}
public void setTaxRate(final Integer taxRate) {
this.taxRate = taxRate;
}
public void setPaymentDays(final Integer paymentDays) {
this.paymentDays = paymentDays;
}
public void setStandbyLinkman(final String standbyLinkman) {
this.standbyLinkman = standbyLinkman;
}
public void setStandbyPhone(final String standbyPhone) {
this.standbyPhone = standbyPhone;
}
public void setStandbyWechat(final String standbyWechat) {
this.standbyWechat = standbyWechat;
}
public void setStandbyEmail(final String standbyEmail) {
this.standbyEmail = standbyEmail;
}
public void setCategoryIdList(final List<Long> categoryIdList) {
this.categoryIdList = categoryIdList;
}
public void setRegistFund(final BigDecimal registFund) {
this.registFund = registFund;
}
public void setEstablishDate(final LocalDate establishDate) {
this.establishDate = establishDate;
}
public void setWorkersNum(final Integer workersNum) {
this.workersNum = workersNum;
}
public void setClientNum(final Integer clientNum) {
this.clientNum = clientNum;
}
public void setLastYearOperatingIncome(final BigDecimal lastYearOperatingIncome) {
this.lastYearOperatingIncome = lastYearOperatingIncome;
}
public void setBeforeYearOperatingIncome(final BigDecimal beforeYearOperatingIncome) {
this.beforeYearOperatingIncome = beforeYearOperatingIncome;
}
public void setBusinessScope(final String businessScope) {
this.businessScope = businessScope;
}
public void setTopFiveClient(final String topFiveClient) {
this.topFiveClient = topFiveClient;
}
public void setTopFiveSupplier(final String topFiveSupplier) {
this.topFiveSupplier = topFiveSupplier;
}
public void setCompanyIntroduction(final String companyIntroduction) {
this.companyIntroduction = companyIntroduction;
}
public void setMainAdvantage(final String mainAdvantage) {
this.mainAdvantage = mainAdvantage;
}
public void setIfReceiveNotice(final Integer ifReceiveNotice) {
this.ifReceiveNotice = ifReceiveNotice;
}
public void setNoticeStyle(final Integer noticeStyle) {
this.noticeStyle = noticeStyle;
}
public void setSupplierUserId(final Long supplierUserId) {
this.supplierUserId = supplierUserId;
}
public void setStatus(final Integer status) {
this.status = status;
}
public void setMainQualificationList(final List<DrpSupplierQualificationUpdateDTO> mainQualificationList) {
this.mainQualificationList = mainQualificationList;
}
public void setDeliverVOList(final List<DrpSupplierDeliverAddDTO> deliverVOList) {
this.deliverVOList = deliverVOList;
}
public void setOtherQualificationList(final List<DrpSupplierQualificationSaveDTO> otherQualificationList) {
this.otherQualificationList = otherQualificationList;
}
public void setAttachmentList(final List<DrpContractAttachmentDTO> attachmentList) {
this.attachmentList = attachmentList;
}
public void setRemark(final String remark) {
this.remark = remark;
}
public String toString() {
Long var10000 = this.getSupplierId();
return "DrpSupplierEditDTO(supplierId=" + var10000 + ", areaId=" + this.getAreaId() + ", supplierName=" + this.getSupplierName() + ", address=" + this.getAddress() + ", linkman=" + this.getLinkman() + ", linkmanNumber=" + this.getLinkmanNumber() + ", email=" + this.getEmail() + ", wechat=" + this.getWechat() + ", openingBank=" + this.getOpeningBank() + ", bankAccount=" + this.getBankAccount() + ", supplierSimpleName=" + this.getSupplierSimpleName() + ", telephone=" + this.getTelephone() + ", companyWeb=" + this.getCompanyWeb() + ", regionProvince=" + this.getRegionProvince() + ", regionCity=" + this.getRegionCity() + ", regionDistrict=" + this.getRegionDistrict() + ", taxRate=" + this.getTaxRate() + ", paymentDays=" + this.getPaymentDays() + ", standbyLinkman=" + this.getStandbyLinkman() + ", standbyPhone=" + this.getStandbyPhone() + ", standbyWechat=" + this.getStandbyWechat() + ", standbyEmail=" + this.getStandbyEmail() + ", categoryIdList=" + String.valueOf(this.getCategoryIdList()) + ", registFund=" + String.valueOf(this.getRegistFund()) + ", establishDate=" + String.valueOf(this.getEstablishDate()) + ", workersNum=" + this.getWorkersNum() + ", clientNum=" + this.getClientNum() + ", lastYearOperatingIncome=" + String.valueOf(this.getLastYearOperatingIncome()) + ", beforeYearOperatingIncome=" + String.valueOf(this.getBeforeYearOperatingIncome()) + ", businessScope=" + this.getBusinessScope() + ", topFiveClient=" + this.getTopFiveClient() + ", topFiveSupplier=" + this.getTopFiveSupplier() + ", companyIntroduction=" + this.getCompanyIntroduction() + ", mainAdvantage=" + this.getMainAdvantage() + ", ifReceiveNotice=" + this.getIfReceiveNotice() + ", noticeStyle=" + this.getNoticeStyle() + ", supplierUserId=" + this.getSupplierUserId() + ", status=" + this.getStatus() + ", mainQualificationList=" + String.valueOf(this.getMainQualificationList()) + ", deliverVOList=" + String.valueOf(this.getDeliverVOList()) + ", otherQualificationList=" + String.valueOf(this.getOtherQualificationList()) + ", idCardImgZ=" + this.getIdCardImgZ() + ", idCardImgF=" + this.getIdCardImgF() + ", attachmentList=" + String.valueOf(this.getAttachmentList()) + ", remark=" + this.getRemark() + ")";
}
}

View File

@ -0,0 +1,36 @@
package com.bonus.canteen.core.drp.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
public class DrpSupplierEditStatusDTO {
@ApiModelProperty("供应商id")
private @NotNull(
message = "供应商id不能为空 ^_^"
) Long supplierId;
@ApiModelProperty("供应商状态(1-待审核,2-审核通过,3-禁用)")
private @NotNull(
message = "供应商状态不能为空 ^_^"
) Integer status;
public Long getSupplierId() {
return this.supplierId;
}
public Integer getStatus() {
return this.status;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setStatus(final Integer status) {
this.status = status;
}
public String toString() {
Long var10000 = this.getSupplierId();
return "DrpSupplierEditStatusDTO(supplierId=" + var10000 + ", status=" + this.getStatus() + ")";
}
}

View File

@ -0,0 +1,84 @@
package com.bonus.canteen.core.drp.dto;
import com.bonus.canteen.core.common.utils.SysUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
@ApiModel
public class DrpSupplierQualificationUpdateDTO {
@ApiModelProperty("id")
private @NotNull(
message = "id不能为空!"
) Long id;
@ApiModelProperty("资质编号")
private String qualificationNum;
@ApiModelProperty("资质名称")
private @NotBlank(
message = "资质名称不能为空!"
) String qualificationName;
@ApiModelProperty("有效期")
private LocalDate validity;
@ApiModelProperty("资质照片")
private String imgUrl;
@ApiModelProperty("供应商id")
private @NotNull(
message = "供应商id不能为空 ^_^"
) Long supplierId;
public void setImgUrl(String imgUrl) {
this.imgUrl = SysUtil.getCutPath(imgUrl);
}
public Long getId() {
return this.id;
}
public String getQualificationNum() {
return this.qualificationNum;
}
public String getQualificationName() {
return this.qualificationName;
}
public LocalDate getValidity() {
return this.validity;
}
public String getImgUrl() {
return this.imgUrl;
}
public Long getSupplierId() {
return this.supplierId;
}
public void setId(final Long id) {
this.id = id;
}
public void setQualificationNum(final String qualificationNum) {
this.qualificationNum = qualificationNum;
}
public void setQualificationName(final String qualificationName) {
this.qualificationName = qualificationName;
}
public void setValidity(final LocalDate validity) {
this.validity = validity;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public String toString() {
Long var10000 = this.getId();
return "DrpSupplierQualificationUpdateDTO(id=" + var10000 + ", qualificationNum=" + this.getQualificationNum() + ", qualificationName=" + this.getQualificationName() + ", validity=" + String.valueOf(this.getValidity()) + ", imgUrl=" + this.getImgUrl() + ", supplierId=" + this.getSupplierId() + ")";
}
}

View File

@ -3,6 +3,8 @@ package com.bonus.canteen.core.drp.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierEditDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierEditStatusDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.model.DrpSupplier;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
@ -15,12 +17,12 @@ public interface DrpSupplierService extends IService<DrpSupplier> {
Page<DrpSupplierPageVO> getDrpSupplierPage(DrpSupplierPageDTO content);
// void editDrpSupplier(DrpSupplierEditDTO content);
//
// void removeBySupplierId(Long supplierId);
//
// void editDrpSupplierStatus(DrpSupplierEditStatusDTO content);
//
void editDrpSupplier(DrpSupplierEditDTO content);
void removeBySupplierId(Long supplierId);
void editDrpSupplierStatus(DrpSupplierEditStatusDTO content);
// List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content);
//
// List<DrpCompariseSupplierQualificationPageVO> compariseSupplierQualification(DrpCompariseSupplierQualificationPageDTO content);

View File

@ -16,9 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.canteen.core.drp.constant.DrpBusinessConstants;
import com.bonus.canteen.core.drp.constant.DrpQuantityMainFlagEnum;
import com.bonus.canteen.core.drp.constant.DrpSupplierStatusEnum;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierQualificationSaveDTO;
import com.bonus.canteen.core.drp.dto.*;
import com.bonus.canteen.core.drp.mapper.DrpSupplierCategoryMapper;
import com.bonus.canteen.core.drp.mapper.DrpSupplierDeliverMapper;
import com.bonus.canteen.core.drp.mapper.DrpSupplierMapper;
@ -40,6 +38,7 @@ import com.bonus.common.houqin.constant.DelFlagEnum;
import com.bonus.common.houqin.i18n.I18n;
import com.bonus.common.houqin.utils.LeBeanUtil;
import com.bonus.common.houqin.utils.id.Id;
import com.bonus.common.security.utils.SecurityUtils;
import com.github.pagehelper.page.PageMethod;
import com.google.common.collect.Maps;
import org.apache.commons.compress.utils.Lists;
@ -232,92 +231,108 @@ public class DrpSupplierServiceImpl extends ServiceImpl<DrpSupplierMapper, DrpSu
}
}
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void editDrpSupplier(DrpSupplierEditDTO content) {
// List<DrpSupplier> check = ((DrpSupplierMapper)this.baseMapper).selectList(((LambdaQueryWrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpSupplier.class).eq(DrpSupplier::getSupplierName, content.getSupplierName())).eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())).ne(DrpSupplier::getSupplierId, content.getSupplierId())).select(new SFunction[]{DrpSupplier::getSupplierId}));
// if (CollUtil.isNotEmpty(check)) {
// throw new LeException(I18n.getMessage("drp.supplier-name-have", new Object[0]));
// } else {
// if (ObjectUtil.isNotEmpty(content.getSupplierUserId())) {
// Long checkSupplierUserId = ((DrpSupplierMapper)this.baseMapper).selectCount((Wrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpSupplier.class).eq(DrpSupplier::getSupplierUserId, content.getSupplierUserId())).eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())).ne(DrpSupplier::getSupplierId, content.getSupplierId()));
// if (checkSupplierUserId > 0L) {
// throw new LeException(I18n.getMessage("drp.supplier-is-bind", new Object[0]));
// }
// }
//
// DrpSupplier supplier = new DrpSupplier();
// BeanUtil.copyProperties(content, supplier, new String[0]);
// this.drpSupplierCategoryService.remove((Wrapper)Wrappers.lambdaQuery(DrpSupplierCategory.class).eq(DrpSupplierCategory::getSupplierId, content.getSupplierId()));
// if (CollUtil.isNotEmpty(content.getCategoryIdList())) {
// this.insertSupplierCategoryBatch(content.getCategoryIdList(), content.getSupplierId());
// }
//
// supplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
// if (CollUtil.isNotEmpty(content.getAttachmentList())) {
// supplier.setAttachment(JSONObject.toJSONString(content.getAttachmentList()));
// }
//
// if (CollUtil.isNotEmpty(content.getDeliverVOList())) {
// this.drpSupplierDeliverMapper.delete((Wrapper)Wrappers.lambdaQuery(DrpSupplierDeliver.class).eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
// content.getDeliverVOList().forEach((d) -> {
// d.setSupplierId(supplier.getSupplierId());
// this.drpSupplierDeliverService.add(d);
// });
// } else {
// this.drpSupplierDeliverMapper.delete((Wrapper)Wrappers.lambdaQuery(DrpSupplierDeliver.class).eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
// }
//
// ((DrpSupplierMapper)this.baseMapper).update(supplier, (Wrapper)Wrappers.lambdaQuery(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId()));
// if (ObjectUtil.isEmpty(content.getSupplierUserId())) {
// ((DrpSupplierMapper)this.baseMapper).update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getSupplierUserId, (Object)null));
// }
//
// Iterator var4 = content.getMainQualificationList().iterator();
//
// DrpSupplierQualification drpSupplierQualification;
// while(var4.hasNext()) {
// DrpSupplierQualificationUpdateDTO drpSupplierQualificationUpdateDTO = (DrpSupplierQualificationUpdateDTO)var4.next();
// drpSupplierQualification = new DrpSupplierQualification();
// BeanUtil.copyProperties(drpSupplierQualificationUpdateDTO, drpSupplierQualification, new String[0]);
// this.drpSupplierQualificationService.updateById(drpSupplierQualification);
// }
//
// if (CollUtil.isNotEmpty(content.getOtherQualificationList())) {
// this.drpSupplierQualificationMapper.delete((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpSupplierQualification.class).eq(DrpSupplierQualification::getSupplierId, content.getSupplierId())).eq(DrpSupplierQualification::getMainFlag, DrpQuantityMainFlagEnum.OTHER.getKey()));
// var4 = content.getOtherQualificationList().iterator();
//
// while(var4.hasNext()) {
// DrpSupplierQualificationSaveDTO drpSupplierQualificationSaveDTO = (DrpSupplierQualificationSaveDTO)var4.next();
// drpSupplierQualification = new DrpSupplierQualification();
// BeanUtil.copyProperties(drpSupplierQualificationSaveDTO, drpSupplierQualification, new String[0]);
// drpSupplierQualification.setSupplierId(supplier.getSupplierId());
// drpSupplierQualification.setMainFlag(DrpQuantityMainFlagEnum.OTHER.getKey());
// this.drpSupplierQualificationService.save(drpSupplierQualification);
// }
// }
//
// }
// }
//
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void removeBySupplierId(Long supplierId) {
// if (ObjectUtil.isEmpty(supplierId)) {
// log.info("***[库存中心_供应商管理]_删除供应商信息_传入的供应商id为空************");
// throw new LeException(I18n.getMessage("drp.supplier-id-is-null", new Object[0]));
// } else {
// ((DrpSupplierMapper)this.baseMapper).update((Object)null, (Wrapper)((LambdaUpdateWrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, supplierId)).set(DrpSupplier::getDelFlag, DelFlagEnum.DEL_TRUE.key())).set(DrpSupplier::getSupplierUserId, (Object)null));
// }
// }
//
// public void editDrpSupplierStatus(DrpSupplierEditStatusDTO content) {
// String username = SecurityUtils.getUser().getUsername();
// ((DrpSupplierMapper)this.baseMapper).update((Object)null, (Wrapper)((LambdaUpdateWrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getStatus, content.getStatus())).set(DrpSupplier::getUpby, username));
// }
//
@Transactional(
rollbackFor = {Exception.class}
)
public void editDrpSupplier(DrpSupplierEditDTO content) {
List<DrpSupplier> check = ((DrpSupplierMapper)this.baseMapper).selectList(Wrappers.lambdaQuery(DrpSupplier.class)
.eq(DrpSupplier::getSupplierName, content.getSupplierName())
.eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())
.ne(DrpSupplier::getSupplierId, content.getSupplierId()).select(DrpSupplier::getSupplierId));
if (CollUtil.isNotEmpty(check)) {
throw new ServiceException(I18n.getMessage("drp.supplier-name-have", new Object[0]));
} else {
if (ObjectUtil.isNotEmpty(content.getSupplierUserId())) {
Long checkSupplierUserId = ((DrpSupplierMapper)this.baseMapper).selectCount(Wrappers.lambdaQuery(DrpSupplier.class)
.eq(DrpSupplier::getSupplierUserId, content.getSupplierUserId())
.eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())
.ne(DrpSupplier::getSupplierId, content.getSupplierId()));
if (checkSupplierUserId > 0L) {
throw new ServiceException(I18n.getMessage("drp.supplier-is-bind", new Object[0]));
}
}
DrpSupplier supplier = new DrpSupplier();
BeanUtil.copyProperties(content, supplier, new String[0]);
this.drpSupplierCategoryService.remove(Wrappers.lambdaQuery(DrpSupplierCategory.class).eq(DrpSupplierCategory::getSupplierId, content.getSupplierId()));
if (CollUtil.isNotEmpty(content.getCategoryIdList())) {
this.insertSupplierCategoryBatch(content.getCategoryIdList(), content.getSupplierId());
}
supplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
if (CollUtil.isNotEmpty(content.getAttachmentList())) {
supplier.setAttachment(JSONObject.toJSONString(content.getAttachmentList()));
}
if (CollUtil.isNotEmpty(content.getDeliverVOList())) {
this.drpSupplierDeliverMapper.delete(Wrappers.lambdaQuery(DrpSupplierDeliver.class)
.eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
content.getDeliverVOList().forEach((d) -> {
d.setSupplierId(supplier.getSupplierId());
this.drpSupplierDeliverService.add(d);
});
} else {
this.drpSupplierDeliverMapper.delete(Wrappers.lambdaQuery(DrpSupplierDeliver.class)
.eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
}
((DrpSupplierMapper)this.baseMapper).update(supplier, Wrappers.lambdaQuery(DrpSupplier.class)
.eq(DrpSupplier::getSupplierId, content.getSupplierId()));
if (ObjectUtil.isEmpty(content.getSupplierUserId())) {
((DrpSupplierMapper)this.baseMapper).update((DrpSupplier) null, (Wrappers.lambdaUpdate(DrpSupplier.class)
.eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getSupplierUserId, (Object)null));
}
Iterator var4 = content.getMainQualificationList().iterator();
DrpSupplierQualification drpSupplierQualification;
while(var4.hasNext()) {
DrpSupplierQualificationUpdateDTO drpSupplierQualificationUpdateDTO = (DrpSupplierQualificationUpdateDTO)var4.next();
drpSupplierQualification = new DrpSupplierQualification();
BeanUtil.copyProperties(drpSupplierQualificationUpdateDTO, drpSupplierQualification, new String[0]);
this.drpSupplierQualificationService.updateById(drpSupplierQualification);
}
if (CollUtil.isNotEmpty(content.getOtherQualificationList())) {
this.drpSupplierQualificationMapper.delete(Wrappers.lambdaQuery(DrpSupplierQualification.class)
.eq(DrpSupplierQualification::getSupplierId, content.getSupplierId())
.eq(DrpSupplierQualification::getMainFlag, DrpQuantityMainFlagEnum.OTHER.getKey()));
var4 = content.getOtherQualificationList().iterator();
while(var4.hasNext()) {
DrpSupplierQualificationSaveDTO drpSupplierQualificationSaveDTO = (DrpSupplierQualificationSaveDTO)var4.next();
drpSupplierQualification = new DrpSupplierQualification();
BeanUtil.copyProperties(drpSupplierQualificationSaveDTO, drpSupplierQualification, new String[0]);
drpSupplierQualification.setSupplierId(supplier.getSupplierId());
drpSupplierQualification.setMainFlag(DrpQuantityMainFlagEnum.OTHER.getKey());
this.drpSupplierQualificationService.save(drpSupplierQualification);
}
}
}
}
@Transactional(
rollbackFor = {Exception.class}
)
public void removeBySupplierId(Long supplierId) {
if (ObjectUtil.isEmpty(supplierId)) {
log.info("***[库存中心_供应商管理]_删除供应商信息_传入的供应商id为空************");
throw new ServiceException(I18n.getMessage("drp.supplier-id-is-null", new Object[0]));
} else {
((DrpSupplierMapper)this.baseMapper).update((DrpSupplier) null,
(Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, supplierId))
.set(DrpSupplier::getDelFlag, DelFlagEnum.DEL_TRUE.key()).set(DrpSupplier::getSupplierUserId, (Object)null));
}
}
public void editDrpSupplierStatus(DrpSupplierEditStatusDTO content) {
String username = SecurityUtils.getUsername();
((DrpSupplierMapper)this.baseMapper).update((DrpSupplier) null, Wrappers.lambdaUpdate(DrpSupplier.class)
.eq(DrpSupplier::getSupplierId, content.getSupplierId())
.set(DrpSupplier::getStatus, content.getStatus()).set(DrpSupplier::getUpby, username));
}
// public List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content) {
// content.setAreaIdList(this.drpAuthorityApi.authAreaList(content.getAreaIdList()));
// return ((DrpSupplierMapper)this.baseMapper).listSupplier(DrpSupplierStatusEnum.NORMAL.key(), DelFlagEnum.DEL_FALSE.key(), content);