供应商列表

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.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.canteen.core.drp.api.DrpAuthorityApi; import com.bonus.canteen.core.drp.api.DrpAuthorityApi;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO; 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.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.service.DrpSupplierService; import com.bonus.canteen.core.drp.service.DrpSupplierService;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO; import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
@ -65,35 +67,27 @@ public class DrpSupplierController {
} }
} }
// @RequiresPermissions({"drp:supplier:update"}) @PostMapping({"/edit"})
// @PostMapping({"/edit"}) @ApiOperation("修改供应商信息")
// @RequiresAuthentication public AjaxResult editDrpSupplier(@RequestBody @Valid DrpSupplierEditDTO dto) {
// @ApiOperation("修改供应商信息") this.drpSupplierService.editDrpSupplier(dto);
// public LeResponse<?> editDrpSupplier(@RequestBody @Valid LeRequest<DrpSupplierEditDTO> leRequest) { return AjaxResult.success();
// DrpSupplierEditDTO content = (DrpSupplierEditDTO)leRequest.getContent(); }
// this.drpSupplierService.editDrpSupplier(content);
// return LeResponse.succ(); @PostMapping({"/remove/{supplierId}"})
// } @ApiOperation("删除供应商信息")
// public AjaxResult removeBySupplierId(@PathVariable Long supplierId) {
// @PostMapping({"/remove/{supplierId}"}) this.drpSupplierService.removeBySupplierId(supplierId);
// @RequiresGuest return AjaxResult.success();
// @ApiOperation("删除供应商信息") }
// @RequiresPermissions({"drp:supplier:delete"})
// public LeResponse<?> removeBySupplierId(@PathVariable Long supplierId) { @PostMapping({"/edit/status"})
// this.drpSupplierService.removeBySupplierId(supplierId); @ApiOperation("变更供应商状态")
// return LeResponse.succ(); public AjaxResult editDrpSupplierStatus(@RequestBody @Valid DrpSupplierEditStatusDTO dto) {
// } this.drpSupplierService.editDrpSupplierStatus(dto);
// return AjaxResult.success();
// @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({"/list/supplier"}) // @PostMapping({"/list/supplier"})
// @RequiresAuthentication // @RequiresAuthentication
// @ApiOperation("查询供应商集合") // @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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO; 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.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.model.DrpSupplier; import com.bonus.canteen.core.drp.model.DrpSupplier;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO; import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
@ -15,12 +17,12 @@ public interface DrpSupplierService extends IService<DrpSupplier> {
Page<DrpSupplierPageVO> getDrpSupplierPage(DrpSupplierPageDTO content); Page<DrpSupplierPageVO> getDrpSupplierPage(DrpSupplierPageDTO content);
// void editDrpSupplier(DrpSupplierEditDTO content); void editDrpSupplier(DrpSupplierEditDTO content);
//
// void removeBySupplierId(Long supplierId); void removeBySupplierId(Long supplierId);
//
// void editDrpSupplierStatus(DrpSupplierEditStatusDTO content); void editDrpSupplierStatus(DrpSupplierEditStatusDTO content);
//
// List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content); // List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content);
// //
// List<DrpCompariseSupplierQualificationPageVO> compariseSupplierQualification(DrpCompariseSupplierQualificationPageDTO 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.DrpBusinessConstants;
import com.bonus.canteen.core.drp.constant.DrpQuantityMainFlagEnum; import com.bonus.canteen.core.drp.constant.DrpQuantityMainFlagEnum;
import com.bonus.canteen.core.drp.constant.DrpSupplierStatusEnum; import com.bonus.canteen.core.drp.constant.DrpSupplierStatusEnum;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO; import com.bonus.canteen.core.drp.dto.*;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierQualificationSaveDTO;
import com.bonus.canteen.core.drp.mapper.DrpSupplierCategoryMapper; import com.bonus.canteen.core.drp.mapper.DrpSupplierCategoryMapper;
import com.bonus.canteen.core.drp.mapper.DrpSupplierDeliverMapper; import com.bonus.canteen.core.drp.mapper.DrpSupplierDeliverMapper;
import com.bonus.canteen.core.drp.mapper.DrpSupplierMapper; 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.i18n.I18n;
import com.bonus.common.houqin.utils.LeBeanUtil; import com.bonus.common.houqin.utils.LeBeanUtil;
import com.bonus.common.houqin.utils.id.Id; import com.bonus.common.houqin.utils.id.Id;
import com.bonus.common.security.utils.SecurityUtils;
import com.github.pagehelper.page.PageMethod; import com.github.pagehelper.page.PageMethod;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
@ -232,92 +231,108 @@ public class DrpSupplierServiceImpl extends ServiceImpl<DrpSupplierMapper, DrpSu
} }
} }
// @Transactional( @Transactional(
// rollbackFor = {Exception.class} rollbackFor = {Exception.class}
// ) )
// public void editDrpSupplier(DrpSupplierEditDTO content) { 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})); List<DrpSupplier> check = ((DrpSupplierMapper)this.baseMapper).selectList(Wrappers.lambdaQuery(DrpSupplier.class)
// if (CollUtil.isNotEmpty(check)) { .eq(DrpSupplier::getSupplierName, content.getSupplierName())
// throw new LeException(I18n.getMessage("drp.supplier-name-have", new Object[0])); .eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())
// } else { .ne(DrpSupplier::getSupplierId, content.getSupplierId()).select(DrpSupplier::getSupplierId));
// if (ObjectUtil.isNotEmpty(content.getSupplierUserId())) { if (CollUtil.isNotEmpty(check)) {
// 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())); throw new ServiceException(I18n.getMessage("drp.supplier-name-have", new Object[0]));
// if (checkSupplierUserId > 0L) { } else {
// throw new LeException(I18n.getMessage("drp.supplier-is-bind", new Object[0])); 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())
// DrpSupplier supplier = new DrpSupplier(); .ne(DrpSupplier::getSupplierId, content.getSupplierId()));
// BeanUtil.copyProperties(content, supplier, new String[0]); if (checkSupplierUserId > 0L) {
// this.drpSupplierCategoryService.remove((Wrapper)Wrappers.lambdaQuery(DrpSupplierCategory.class).eq(DrpSupplierCategory::getSupplierId, content.getSupplierId())); throw new ServiceException(I18n.getMessage("drp.supplier-is-bind", new Object[0]));
// if (CollUtil.isNotEmpty(content.getCategoryIdList())) { }
// this.insertSupplierCategoryBatch(content.getCategoryIdList(), content.getSupplierId()); }
// }
// DrpSupplier supplier = new DrpSupplier();
// supplier.setDelFlag(DelFlagEnum.DEL_FALSE.key()); BeanUtil.copyProperties(content, supplier, new String[0]);
// if (CollUtil.isNotEmpty(content.getAttachmentList())) { this.drpSupplierCategoryService.remove(Wrappers.lambdaQuery(DrpSupplierCategory.class).eq(DrpSupplierCategory::getSupplierId, content.getSupplierId()));
// supplier.setAttachment(JSONObject.toJSONString(content.getAttachmentList())); if (CollUtil.isNotEmpty(content.getCategoryIdList())) {
// } this.insertSupplierCategoryBatch(content.getCategoryIdList(), content.getSupplierId());
// }
// if (CollUtil.isNotEmpty(content.getDeliverVOList())) {
// this.drpSupplierDeliverMapper.delete((Wrapper)Wrappers.lambdaQuery(DrpSupplierDeliver.class).eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId())); supplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
// content.getDeliverVOList().forEach((d) -> { if (CollUtil.isNotEmpty(content.getAttachmentList())) {
// d.setSupplierId(supplier.getSupplierId()); supplier.setAttachment(JSONObject.toJSONString(content.getAttachmentList()));
// this.drpSupplierDeliverService.add(d); }
// });
// } else { if (CollUtil.isNotEmpty(content.getDeliverVOList())) {
// this.drpSupplierDeliverMapper.delete((Wrapper)Wrappers.lambdaQuery(DrpSupplierDeliver.class).eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId())); this.drpSupplierDeliverMapper.delete(Wrappers.lambdaQuery(DrpSupplierDeliver.class)
// } .eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
// content.getDeliverVOList().forEach((d) -> {
// ((DrpSupplierMapper)this.baseMapper).update(supplier, (Wrapper)Wrappers.lambdaQuery(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId())); d.setSupplierId(supplier.getSupplierId());
// if (ObjectUtil.isEmpty(content.getSupplierUserId())) { this.drpSupplierDeliverService.add(d);
// ((DrpSupplierMapper)this.baseMapper).update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getSupplierUserId, (Object)null)); });
// } } else {
// this.drpSupplierDeliverMapper.delete(Wrappers.lambdaQuery(DrpSupplierDeliver.class)
// Iterator var4 = content.getMainQualificationList().iterator(); .eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
// }
// DrpSupplierQualification drpSupplierQualification;
// while(var4.hasNext()) { ((DrpSupplierMapper)this.baseMapper).update(supplier, Wrappers.lambdaQuery(DrpSupplier.class)
// DrpSupplierQualificationUpdateDTO drpSupplierQualificationUpdateDTO = (DrpSupplierQualificationUpdateDTO)var4.next(); .eq(DrpSupplier::getSupplierId, content.getSupplierId()));
// drpSupplierQualification = new DrpSupplierQualification(); if (ObjectUtil.isEmpty(content.getSupplierUserId())) {
// BeanUtil.copyProperties(drpSupplierQualificationUpdateDTO, drpSupplierQualification, new String[0]); ((DrpSupplierMapper)this.baseMapper).update((DrpSupplier) null, (Wrappers.lambdaUpdate(DrpSupplier.class)
// this.drpSupplierQualificationService.updateById(drpSupplierQualification); .eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getSupplierUserId, (Object)null));
// } }
//
// if (CollUtil.isNotEmpty(content.getOtherQualificationList())) { Iterator var4 = content.getMainQualificationList().iterator();
// this.drpSupplierQualificationMapper.delete((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpSupplierQualification.class).eq(DrpSupplierQualification::getSupplierId, content.getSupplierId())).eq(DrpSupplierQualification::getMainFlag, DrpQuantityMainFlagEnum.OTHER.getKey()));
// var4 = content.getOtherQualificationList().iterator(); DrpSupplierQualification drpSupplierQualification;
// while(var4.hasNext()) {
// while(var4.hasNext()) { DrpSupplierQualificationUpdateDTO drpSupplierQualificationUpdateDTO = (DrpSupplierQualificationUpdateDTO)var4.next();
// DrpSupplierQualificationSaveDTO drpSupplierQualificationSaveDTO = (DrpSupplierQualificationSaveDTO)var4.next(); drpSupplierQualification = new DrpSupplierQualification();
// drpSupplierQualification = new DrpSupplierQualification(); BeanUtil.copyProperties(drpSupplierQualificationUpdateDTO, drpSupplierQualification, new String[0]);
// BeanUtil.copyProperties(drpSupplierQualificationSaveDTO, drpSupplierQualification, new String[0]); this.drpSupplierQualificationService.updateById(drpSupplierQualification);
// drpSupplierQualification.setSupplierId(supplier.getSupplierId()); }
// drpSupplierQualification.setMainFlag(DrpQuantityMainFlagEnum.OTHER.getKey());
// this.drpSupplierQualificationService.save(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()) {
// @Transactional( DrpSupplierQualificationSaveDTO drpSupplierQualificationSaveDTO = (DrpSupplierQualificationSaveDTO)var4.next();
// rollbackFor = {Exception.class} drpSupplierQualification = new DrpSupplierQualification();
// ) BeanUtil.copyProperties(drpSupplierQualificationSaveDTO, drpSupplierQualification, new String[0]);
// public void removeBySupplierId(Long supplierId) { drpSupplierQualification.setSupplierId(supplier.getSupplierId());
// if (ObjectUtil.isEmpty(supplierId)) { drpSupplierQualification.setMainFlag(DrpQuantityMainFlagEnum.OTHER.getKey());
// log.info("***[库存中心_供应商管理]_删除供应商信息_传入的供应商id为空************"); this.drpSupplierQualificationService.save(drpSupplierQualification);
// 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) { @Transactional(
// String username = SecurityUtils.getUser().getUsername(); rollbackFor = {Exception.class}
// ((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)); )
// } 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) { // public List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content) {
// content.setAreaIdList(this.drpAuthorityApi.authAreaList(content.getAreaIdList())); // content.setAreaIdList(this.drpAuthorityApi.authAreaList(content.getAreaIdList()));
// return ((DrpSupplierMapper)this.baseMapper).listSupplier(DrpSupplierStatusEnum.NORMAL.key(), DelFlagEnum.DEL_FALSE.key(), content); // return ((DrpSupplierMapper)this.baseMapper).listSupplier(DrpSupplierStatusEnum.NORMAL.key(), DelFlagEnum.DEL_FALSE.key(), content);