This commit is contained in:
linfso 2025-05-13 17:42:16 +08:00
parent 6d71078e46
commit fb9ecef397

View File

@ -81,24 +81,24 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
@Override @Override
public int insertEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch) public int insertEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch)
{ {
// 产生批次号 // // 产生批次号
String yyMMdd = "yyMMdd"; // String yyMMdd = "yyMMdd";
// 站点三字码 // // 站点三字码
String siteThreeCode="--"; // String siteThreeCode="--";
try{ // try{
//
EmisSite site=getSiteByCode(SecurityUtils.getLoginUser().getUser().getOwnerSiteCode()); // EmisSite site=getSiteByCode(SecurityUtils.getLoginUser().getUser().getOwnerSiteCode());
if(!StringUtils.isEmpty(site.getSizeCode3())) { // if(!StringUtils.isEmpty(site.getSizeCode3())) {
siteThreeCode = site.getSizeCode3(); // siteThreeCode = site.getSizeCode3();
} // }
}catch (Exception ex){ // }catch (Exception ex){
ex.printStackTrace(); // ex.printStackTrace();
} // }
//
String batchKey= "B"+siteThreeCode+ DateUtils.parseDateToStr(yyMMdd,new Date()); // String batchKey= "B"+siteThreeCode+ DateUtils.parseDateToStr(yyMMdd,new Date());
Long lockNo = redissonService.addAndGetLong(batchKey,1L); // Long lockNo = redissonService.addAndGetLong(batchKey,1L);
String batchNo =batchKey +StringUtils.leftPad(String.valueOf(lockNo),2,"0"); // String batchNo =batchKey +StringUtils.leftPad(String.valueOf(lockNo),2,"0");
emisTmsSiteBatch.setBatchNo(batchNo); // emisTmsSiteBatch.setBatchNo(batchNo);
// 插入明细数据 // 插入明细数据
if(!CollectionUtils.isEmpty(emisTmsSiteBatch.getBatchDtlList())){ if(!CollectionUtils.isEmpty(emisTmsSiteBatch.getBatchDtlList())){