forked from I3-YF/i3plus-mes-pcn-yfai
打印主条码工步
parent
b3a96c4387
commit
fd2e5dc22e
@ -0,0 +1,55 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.strategy;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.IPrintTemplateStrategyService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2024/6/17 16:10
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class GqaaPrintStrategy implements IPrintTemplateStrategyService {
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(MesProductionPsOutContext sn, String organizeCode) {
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
|
||||||
|
String partNo = sn.getPartNo();
|
||||||
|
String partName = sn.getPartName();
|
||||||
|
String factoryName = AuthUtil.getOrganize().getName();
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yy/MM/dd");
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
String productDate = now.format(formatter);
|
||||||
|
|
||||||
|
//构造二维码
|
||||||
|
StringBuilder barcode = new StringBuilder();
|
||||||
|
|
||||||
|
//第三位 供应商代码 // 配置表
|
||||||
|
String supplierCode = "VD501";
|
||||||
|
barcode.append(supplierCode);
|
||||||
|
//第四位 生产线代号 // 配置表
|
||||||
|
String workCenterCode = "1";
|
||||||
|
barcode.append(workCenterCode);
|
||||||
|
|
||||||
|
int no = 1;
|
||||||
|
String noStr = String.format("%07d", no);
|
||||||
|
map.put("no",noStr);
|
||||||
|
map.put("partNo", partNo);
|
||||||
|
map.put("partName", partName);
|
||||||
|
map.put("factoryName", factoryName);
|
||||||
|
map.put("productDate", productDate);
|
||||||
|
map.put("barcode", barcode.toString());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue