Merge remote-tracking branch 'origin/master'

new
Agoni 1 year ago
commit f330e974e8

@ -23,7 +23,7 @@ public class PageParam implements Serializable {
@Schema(description = "每页条数,最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") @Schema(description = "每页条数,最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
@NotNull(message = "每页条数不能为空") @NotNull(message = "每页条数不能为空")
@Min(value = 1, message = "每页条数最小值为 1") @Min(value = 1, message = "每页条数最小值为 1")
@Max(value = 100, message = "每页条数最大值为 100") @Max(value = 1000, message = "每页条数最大值为 1000")
private Integer pageSize = PAGE_SIZE; private Integer pageSize = PAGE_SIZE;
} }

@ -27,7 +27,7 @@ public class DateUtils {
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss"; public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";
public static final String FORMAT_HOUR_MINUTE_SECOND = "HH:mm:ss"; public static final String FORMAT_HOUR_MINUTE_SECOND = "HH:mm:ss";
public static final String FORMAT_HOUR_MINUT = "HHmmss"; public static final String FORMAT_HOUR_MINUT = "yyyyMMdd";
/** /**
* LocalDateTime Date * LocalDateTime Date

@ -11,6 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Set;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -67,4 +68,7 @@ public class InvoicePageReqVO extends PageParam {
@Schema(description = "备注", example = "随便") @Schema(description = "备注", example = "随便")
private String remark; private String remark;
private Set<Long> inIds;
private Set<Long> notInIds;
} }

@ -10,5 +10,7 @@ import javax.validation.constraints.*;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class QuotationSheetCreateReqVO extends QuotationSheetBaseVO { public class QuotationSheetCreateReqVO extends QuotationSheetBaseVO {
@Schema(description = "物料id集合", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "物料id集合不能为空")
private List<Long> suppliesIdList;
} }

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bs.controller.admin.suppliercompany.vo; package cn.iocoder.yudao.module.bs.controller.admin.suppliercompany.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@ -74,7 +75,7 @@ public class SupplierCompanyBaseVO {
private String bankOfDeposit; private String bankOfDeposit;
@Schema(description = "是否注册", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "是否注册", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "是否注册不能为空") // @NotNull(message = "是否注册不能为空")
private Byte isRegister; private Byte isRegister;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ -84,7 +85,12 @@ public class SupplierCompanyBaseVO {
@Schema(description = "备注", example = "随便") @Schema(description = "备注", example = "随便")
private String remark; private String remark;
@Schema(description = "附件") @Schema(description = "附件", requiredMode = Schema.RequiredMode.REQUIRED)
private String files; private List<ImageVo> files;
/**
* id
*/
private Long correlationUserId;
} }

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bs.controller.admin.suppliercompany.vo; package cn.iocoder.yudao.module.bs.controller.admin.suppliercompany.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@ -70,7 +71,7 @@ public class SupplierCompanyExcelVO {
private String remark; private String remark;
@ExcelProperty("附件") @ExcelProperty("附件")
private String files; private List<ImageVo> files;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;

@ -95,6 +95,10 @@ public class SupplierCompanyDO extends BaseDO {
* *
*/ */
private String remark; private String remark;
/**
* id
*/
private Long correlationUserId;
/** /**
* *
*/ */

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bs.dal.mysql.invoice; package cn.iocoder.yudao.module.bs.dal.mysql.invoice;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
@ -19,8 +20,8 @@ import java.util.List;
public interface InvoiceMapper extends BaseMapperX<InvoiceDO> { public interface InvoiceMapper extends BaseMapperX<InvoiceDO> {
default PageResult<InvoiceDO> selectPage(InvoicePageReqVO reqVO) { default PageResult<InvoiceDO> selectPage(InvoicePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<InvoiceDO>() LambdaQueryWrapperX<InvoiceDO> queryWrapper = new LambdaQueryWrapperX<InvoiceDO>()
.eqIfPresent(InvoiceDO::getFiles, reqVO.getFiles()) .inIfPresent(InvoiceDO::getId, reqVO.getInIds())
.betweenIfPresent(InvoiceDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(InvoiceDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(InvoiceDO::getInvoiceType, reqVO.getInvoiceType()) .eqIfPresent(InvoiceDO::getInvoiceType, reqVO.getInvoiceType())
.eqIfPresent(InvoiceDO::getInvoiceCode, reqVO.getInvoiceCode()) .eqIfPresent(InvoiceDO::getInvoiceCode, reqVO.getInvoiceCode())
@ -33,7 +34,11 @@ public interface InvoiceMapper extends BaseMapperX<InvoiceDO> {
.eqIfPresent(InvoiceDO::getDeptId, reqVO.getDeptId()) .eqIfPresent(InvoiceDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(InvoiceDO::getDeptName, reqVO.getDeptName()) .likeIfPresent(InvoiceDO::getDeptName, reqVO.getDeptName())
.eqIfPresent(InvoiceDO::getRemark, reqVO.getRemark()) .eqIfPresent(InvoiceDO::getRemark, reqVO.getRemark())
.orderByDesc(InvoiceDO::getId)); .orderByDesc(InvoiceDO::getId);
if (CollUtil.isNotEmpty(reqVO.getNotInIds())) {
queryWrapper.notIn(InvoiceDO::getId, reqVO.getNotInIds());
}
return selectPage(reqVO, queryWrapper);
} }
default List<InvoiceDO> selectList(InvoiceExportReqVO reqVO) { default List<InvoiceDO> selectList(InvoiceExportReqVO reqVO) {

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bs.service.quotationsheet; package cn.iocoder.yudao.module.bs.service.quotationsheet;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -31,6 +32,10 @@ public class QuotationSheetServiceImpl implements QuotationSheetService {
public Long createQuotationSheet(QuotationSheetCreateReqVO createReqVO) { public Long createQuotationSheet(QuotationSheetCreateReqVO createReqVO) {
// 插入 // 插入
QuotationSheetDO quotationSheet = QuotationSheetConvert.INSTANCE.convert(createReqVO); QuotationSheetDO quotationSheet = QuotationSheetConvert.INSTANCE.convert(createReqVO);
if (null != createReqVO.getSuppliesIdList()){
quotationSheet.setMaterialIdList(createReqVO.getSuppliesIdList().toString());
}
// SecurityFrameworkUtils.getLoginUser().
quotationSheetMapper.insert(quotationSheet); quotationSheetMapper.insert(quotationSheet);
// 返回 // 返回
return quotationSheet.getId(); return quotationSheet.getId();

@ -7,6 +7,9 @@ import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.util.*; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import cn.iocoder.yudao.module.bs.controller.admin.suppliercompany.vo.*; import cn.iocoder.yudao.module.bs.controller.admin.suppliercompany.vo.*;
import cn.iocoder.yudao.module.bs.dal.dataobject.suppliercompany.SupplierCompanyDO; import cn.iocoder.yudao.module.bs.dal.dataobject.suppliercompany.SupplierCompanyDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -37,6 +40,7 @@ public class SupplierCompanyServiceImpl implements SupplierCompanyService {
String companyNumber = numberCreate(); String companyNumber = numberCreate();
supplierCompany.setCompanyNumber(companyNumber); supplierCompany.setCompanyNumber(companyNumber);
supplierCompanyMapper.insert(supplierCompany); supplierCompanyMapper.insert(supplierCompany);
// 返回 // 返回
return supplierCompany.getId(); return supplierCompany.getId();
} }
@ -91,44 +95,22 @@ public class SupplierCompanyServiceImpl implements SupplierCompanyService {
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
Date date = new Date(currentTime); Date date = new Date(currentTime);
String companyNumber="gys"+ DateUtils.dateToStr(DateUtils.FORMAT_HOUR_MINUT,date); String companyNumber="gys"+ DateUtils.dateToStr(DateUtils.FORMAT_HOUR_MINUT,date);
Long companyNumberSize = supplierCompanyMapper.selectCount(new QueryWrapper<SupplierCompanyDO>().likeLeft("company_number", companyNumber)); SupplierCompanyDO supplierCompanyDO = supplierCompanyMapper.selectOne(new QueryWrapper<SupplierCompanyDO>().like("company_number", companyNumber).orderByDesc("create_time").last("limit 1"));
Long l = companyNumberSize + 1L; if (null!=supplierCompanyDO){
int length = String.valueOf(companyNumberSize + 1L).length(); Long aLong = numKun(supplierCompanyDO.getCompanyNumber());
if ((4-length) !=0){ companyNumber ="gys"+(aLong+1);
String gys = fillStr("", (4-length), true, "0");
companyNumber=companyNumber+gys+l.intValue();
}else { }else {
companyNumber=companyNumber+l; companyNumber=companyNumber+"0000";
long l = numKun(companyNumber) + 1;
companyNumber ="gys"+(numKun(companyNumber) + 1);
} }
return companyNumber; return companyNumber;
} }
public Long numKun(String a){
private String fillStr(String value, int count, boolean frontORback, String fillChar) { String regEx = "[^0-9]";
String rtvalue = value; Pattern p = Pattern.compile(regEx);
if (rtvalue == null) { Matcher m = p.matcher(a);
rtvalue = ""; String result = m.replaceAll("").trim();
for (int i = 0; i < count; i++) return Long.valueOf(result);
if (frontORback)
rtvalue = String.valueOf(rtvalue)
+ String.valueOf(fillChar);
else
rtvalue = String.valueOf(fillChar)
+ String.valueOf(rtvalue);
} else {
int len = rtvalue.length();
if (len > count) {
rtvalue = rtvalue.substring(0, count);
} else {
int a = count - len;
for (int i = 0; i < a; i++)
if (frontORback)
rtvalue = String.valueOf(rtvalue)
+ String.valueOf(fillChar);
else
rtvalue = String.valueOf(fillChar)
+ String.valueOf(rtvalue);
}
}
return rtvalue;
} }
} }

Loading…
Cancel
Save