Commit 8aa5d1b1 by yyq1988

Merge remote-tracking branch 'origin/master'

parents ddacd9b7 130851a7
...@@ -23,6 +23,8 @@ import com.jeeplus.modules.warehouse.qrcode.entity.QrCode; ...@@ -23,6 +23,8 @@ import com.jeeplus.modules.warehouse.qrcode.entity.QrCode;
import com.jeeplus.modules.warehouse.qrcode.mapper.QrCodeMapper; import com.jeeplus.modules.warehouse.qrcode.mapper.QrCodeMapper;
import com.jeeplus.modules.warehouse.qrcode.service.QrCodeService; import com.jeeplus.modules.warehouse.qrcode.service.QrCodeService;
import com.jeeplus.modules.warehouse.qrcode.util.BuildQcUtil; import com.jeeplus.modules.warehouse.qrcode.util.BuildQcUtil;
import com.jeeplus.modules.warehouse.wzcode.entity.Wzcode;
import com.jeeplus.modules.warehouse.wzcode.service.WzcodeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -56,6 +58,8 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe ...@@ -56,6 +58,8 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe
private LedgerService ledgerService; private LedgerService ledgerService;
@Autowired @Autowired
private QrCodeService qrCodeService; private QrCodeService qrCodeService;
@Autowired
private WzcodeService wzcodeService;
public ProfitWarehousing get(String id) { public ProfitWarehousing get(String id) {
ProfitWarehousing profitWarehousing = super.get(id); ProfitWarehousing profitWarehousing = super.get(id);
...@@ -87,24 +91,27 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe ...@@ -87,24 +91,27 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe
file .mkdirs(); file .mkdirs();
} }
ProfitWarehousingInfo profitWarehousingInfo = profitWarehousingInfoMapper.get(infoId); ProfitWarehousingInfo profitWarehousingInfo = profitWarehousingInfoMapper.get(infoId);
String numSeq = CodeUtil.code("WZBM", StaticNumSeq.WZBM); // String numSeq = CodeUtil.code("WZBM", StaticNumSeq.WZBM);
Wzcode wzcode = wzcodeService.findByCode(profitWarehousingInfo.getType().getCode());
QrCode qrCode = new QrCode(); QrCode qrCode = new QrCode();
qrCode.setProfitWarehousingInfo(profitWarehousingInfo); qrCode.setProfitWarehousingInfo(profitWarehousingInfo);
qrCode.setComeFlag("1"); qrCode.setComeFlag("1");
qrCode.setCode(numSeq); qrCode.setCode(wzcode.getCodeAndNum());
qrCode.setState("0"); qrCode.setState("0");
qrCode.preInsert(); qrCode.preInsert();
try { try {
BuildQcUtil.buildQrOne(qrCode, qrImgPath + "/" + numSeq + ".png", qrImgPath + "/" + numSeq + "_0"+ ".png"); // 生成图片 BuildQcUtil.buildQrOne(qrCode, qrImgPath + "/" + wzcode.getCodeAndNum() + ".png", qrImgPath + "/" + wzcode.getCodeAndNum() + "_0"+ ".png"); // 生成图片
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
qrCode.setUrl(Global.getAttachmentUrl() + "image/" + numSeq + "_0" + ".png"); qrCode.setUrl(Global.getAttachmentUrl() + "image/" + wzcode.getCodeAndNum() + "_0" + ".png");
qrCodeMapper.insert(qrCode); qrCodeMapper.insert(qrCode);
qrCode = qrCodeMapper.get(qrCode.getId()); qrCode = qrCodeMapper.get(qrCode.getId());
profitWarehousingInfo.setQrCode(qrCode); profitWarehousingInfo.setQrCode(qrCode);
profitWarehousingInfo.preUpdate(); profitWarehousingInfo.preUpdate();
profitWarehousingInfoMapper.update(profitWarehousingInfo); profitWarehousingInfoMapper.update(profitWarehousingInfo);
// 更新物资编码表
wzcodeService.save(wzcode);
return profitWarehousingInfo; return profitWarehousingInfo;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment