1.增加接口授权及鉴权功能

master
董哲奇 2 weeks ago
parent c09a4a7aed
commit 7e463e9d24

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dsic.gj_erp.bean.pgd.PgdTzjh;
import com.dsic.gj_erp.bean.zyjh.DmYlInfo;
import com.dsic.gj_erp.exception.ServiceException;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -241,6 +242,22 @@ public class DmYdjh implements Serializable {
private String ylbhgg;
//fixme 正式使用时需取消@TableField(exist = false)
@TableField(exist = false)
private String jhsyylbh;//计划使用余料编号
@TableField(exist = false)
private String ylCh;//来源余料船号
@TableField(exist = false)
private String ylPl;//来源余料批量
@TableField(exist = false)
private String ylTh;//来源余料图号
@TableField(exist = false)
private String ylbh;//来源余料编号
private String parentId;
private String db;
private String cx;
@ -412,8 +429,25 @@ public class DmYdjh implements Serializable {
return StrUtil.format("{}_{}_{}_{}",this.dcCh,this.dcPl,this.dcFd,this.tzbh);
}
public DmYdjh ofPrintForSl(DmYlInfo item,String date){
DmYdjh dmYdjh = new DmYdjh();
dmYdjh.setId(this.id);
dmYdjh.setYlCh(item.get());
dmYdjh.setYlPl(item.get());
dmYdjh.setYlTh(item.get());
dmYdjh.setYlbh(item.get());
dmYdjh.setSllph(item.get());
//fixme 不确定是否还需要抛丸,先执行到抛丸反馈
dmYdjh.setSlfkrq(date);
dmYdjh.setZtForPwfk();
if ("17".equals(this.kw)){//光电直接切割
dmYdjh.setZtForHXFK();
}
return dmYdjh;
}
public boolean 使(){
return false;
return StrUtil.isNotEmpty(this.ylCh);
}
public void setZtForSl(){
@ -450,13 +484,13 @@ public class DmYdjh implements Serializable {
}else{
ZyjhzxEnum zt = ZyjhzxEnum.getEnumByCode(this.zt);
if (zyjhzxEnum==null){
throw new ServiceException(10001,"作业计划执行内容不存在");
throw new ServiceException(10001,"作业计划执行状态错误");
}
this.zt=zyjhzxEnum.computeCode<=zt.computeCode?zt.code:zyjhzxEnum.code;
}
}
@Getter
@AllArgsConstructor
private enum ZyjhzxEnum{
YXF("2",2),
@ -477,10 +511,8 @@ public class DmYdjh implements Serializable {
,DM("85",85),DMFK("86",86),
WC("99",99)//完成
;
@Getter
public String code;
@Getter
public Integer computeCode;
public final String code;
public final Integer computeCode;
public static ZyjhzxEnum getEnumByCode(String code){
for (ZyjhzxEnum em:ZyjhzxEnum.values()){

@ -11,6 +11,7 @@ import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.Arrays;
@Getter
@Setter
@ -64,7 +65,7 @@ public class DmYlInfo {
private int 使;//0:未使用;1:已使用;2:已打印;3:已切割
public boolean (String ){
return StrUtil.isNotEmpty(this.) &&this..equals();
return StrUtil.isNotEmpty(this.) && this..equals();
}
public boolean (DmYdjh ydjh){
@ -108,8 +109,8 @@ public class DmYlInfo {
dmYlInfo.=bchxylp.getYlbh();
String _=null;
if(StrUtil.isNotEmpty(ydjh.getWpgg())){
String[] _split=ydjh.getWpgg().split("\\*");
if(StrUtil.isNotEmpty(bchxylp.getWpgg())){
String[] _split=bchxylp.getWpgg().split("\\*");
if (_split.length>=3){
_=_split[0];
}
@ -124,7 +125,7 @@ public class DmYlInfo {
if (split.length==2){
if(StrUtil.isNotEmpty(_)){
dmYlInfo.=new BigDecimal(_);
dmYlInfo.=_+"\\*"+dmYlInfo.;
dmYlInfo.=_+"*"+dmYlInfo.;
}
dmYlInfo.=new BigDecimal(split[0]);
dmYlInfo.=new BigDecimal(split[1]);
@ -153,4 +154,10 @@ public class DmYlInfo {
public enum UseStatus{
使,使,,
}
public static void main(String[] args) {
String a="1527*11360";
System.out.println(a.split("\\*").length);
// System.out.println(a.substring(a.indexOf("*")+1));
}
}

@ -17,8 +17,6 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -38,6 +36,8 @@ public class YlController {
ylInfoService.list(Wrappers.<DmYlInfo>lambdaQuery()
.eq(DmYlInfo::get,dto.getDcCh())
.eq(DmYlInfo::get使,dto.getStatus())
//查询结果使用最小匹配原则为按规格匹配上料提供匹配顺序
.orderByAsc(DmYlInfo::get,DmYlInfo::get)
)
);
}
@ -95,23 +95,19 @@ public class YlController {
.eq(DmYdjh::getDcCh, item.get使())
.eq(DmYdjh::getTzbh,item.get使())
);
//防止手动编辑错误时的校验
if (ObjectUtil.isEmpty(ydjhList)){
String str=StrUtil.format("使用船号:{},使用图号{}错误,请核对修正后再打印", item.get使(), item.get使());
throw new ServiceException(99999,str);
}
List<DmYdjh> collect = ydjhList.stream().peek(it -> {
//fixme 确定以下方法具体算法
List<DmYdjh> collect = ydjhList.stream().map(it -> {
//防止手动编辑错误时的校验
if (it.使()){
String str=StrUtil.format("作业计划船号:{},图号{}已使用,请核对修正后再打印", item.get使(), item.get使());
String str=StrUtil.format("作业计划船号:{},图号{}已用,请核对修正后再打印", item.get使(), item.get使());
throw new ServiceException(99999,str);
}
it.setSllph(item.get());
it.setSlfkrq(date);
//fixme 不确定是否还需要抛丸,先执行到上料
it.setZtForPwfk();
if ("17".equals(it.getKw())){//光电直接切割
it.setZtForHXFK();
}
return it.ofPrintForSl(item,date);
}).collect(Collectors.toList());
updateList.addAll(collect);
@ -125,7 +121,7 @@ public class YlController {
}
/**
*
*
*
*/
@PostMapping("sl")
@ -140,14 +136,18 @@ public class YlController {
List<DmYdjh> list = ydjhService.list(Wrappers.<DmYdjh>lambdaQuery()
.eq(DmYdjh::getDcCh, dto.getDcCh())
.eq(DmYdjh::getDcPl, dto.getDcPl())
.eq(DmYdjh::getYlbs,"Y")
.and(item->item.isNull(DmYdjh::getYlCh).or().eq(DmYdjh::getYlCh,""))
.eq(StrUtil.isNotEmpty(dto.getTzbh()),DmYdjh::getTzbh,dto.getTzbh())
.orderByDesc(DmYdjh::getWpgg)
);
List<DmYlInfo> =new ArrayList<>();
out:
for (DmYdjh ydjh:list){
for(DmYlInfo ylInfo:dto.getYlList()){
if (ylInfo.(ydjh.getYlbhgg())&&ylInfo.(ydjh)){//暂时不支持,仅保留分支流程
if (ylInfo.(ydjh.getYlbhgg())){//暂时不支持,仅保留分支流程
ylInfo.(ydjh);
.add(ylInfo);
continue out;

Loading…
Cancel
Save