Merge branch 'master' of http://git.xdadan.loc/tanex/emis-service
This commit is contained in:
commit
9689ac0c7f
@ -234,10 +234,36 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||
for (EmisTmsSiteBatch batch : batchList) {
|
||||
// 先查询数据库中的完整数据
|
||||
EmisTmsSiteBatch dbBatch = emisTmsSiteBatchService.selectEmisTmsSiteBatchById(batch.getId());
|
||||
if (dbBatch == null) {
|
||||
return AjaxResult.error("批次ID " + batch.getId() + " 不存在");
|
||||
}
|
||||
|
||||
// 使用前端传来的值更新数据库中的值
|
||||
if (batch.getTransType() != null) {
|
||||
dbBatch.setTransType(batch.getTransType());
|
||||
}
|
||||
if (batch.getStartSiteCode() != null) {
|
||||
dbBatch.setStartSiteCode(batch.getStartSiteCode());
|
||||
}
|
||||
if (batch.getSupplierCode() != null) {
|
||||
dbBatch.setSupplierCode(batch.getSupplierCode());
|
||||
}
|
||||
if (batch.getNextSiteCode() != null) {
|
||||
dbBatch.setNextSiteCode(batch.getNextSiteCode());
|
||||
}
|
||||
if (batch.getEtd() != null) {
|
||||
dbBatch.setEtd(batch.getEtd());
|
||||
}
|
||||
if (batch.getCarNo() != null) {
|
||||
dbBatch.setCarNo(batch.getCarNo());
|
||||
}
|
||||
|
||||
// 运输方式首字母
|
||||
String prefix = "E";
|
||||
if (batch.getTransType() != null) {
|
||||
switch (batch.getTransType()) {
|
||||
if (dbBatch.getTransType() != null) {
|
||||
switch (dbBatch.getTransType()) {
|
||||
case "1":
|
||||
prefix = "E";
|
||||
break;
|
||||
@ -260,9 +286,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
||||
}
|
||||
// 起始网点三字码
|
||||
String startSiteCode3 = "";
|
||||
if (batch.getStartSiteCode() != null) {
|
||||
if (dbBatch.getStartSiteCode() != null) {
|
||||
EmisSite startSite = new EmisSite();
|
||||
startSite.setSiteCode(batch.getStartSiteCode());
|
||||
startSite.setSiteCode(dbBatch.getStartSiteCode());
|
||||
List<EmisSite> startSites = emisSiteService.selectEmisSiteList(startSite);
|
||||
if (!CollectionUtils.isEmpty(startSites)) {
|
||||
startSiteCode3 = startSites.get(0).getSizeCode3();
|
||||
@ -270,9 +296,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
||||
}
|
||||
// 供应商英文名
|
||||
String supplierNameEn = "";
|
||||
if (batch.getSupplierCode() != null) {
|
||||
if (dbBatch.getSupplierCode() != null) {
|
||||
EmisSupplier supplier = new EmisSupplier();
|
||||
supplier.setCode(batch.getSupplierCode());
|
||||
supplier.setCode(dbBatch.getSupplierCode());
|
||||
List<EmisSupplier> suppliers = emisSupplierService.selectEmisSupplierList(supplier);
|
||||
if (!CollectionUtils.isEmpty(suppliers)) {
|
||||
supplierNameEn = suppliers.get(0).getNameEn();
|
||||
@ -280,9 +306,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
||||
}
|
||||
// 下一网点三字码
|
||||
String nextSiteCode3 = "";
|
||||
if (batch.getNextSiteCode() != null) {
|
||||
if (dbBatch.getNextSiteCode() != null) {
|
||||
EmisSite nextSite = new EmisSite();
|
||||
nextSite.setSiteCode(batch.getNextSiteCode());
|
||||
nextSite.setSiteCode(dbBatch.getNextSiteCode());
|
||||
List<EmisSite> nextSites = emisSiteService.selectEmisSiteList(nextSite);
|
||||
if (!CollectionUtils.isEmpty(nextSites)) {
|
||||
nextSiteCode3 = nextSites.get(0).getSizeCode3();
|
||||
@ -290,15 +316,15 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
||||
}
|
||||
// etd日期
|
||||
String etdStr = "";
|
||||
if (batch.getEtd() != null) {
|
||||
etdStr = sdf.format(batch.getEtd());
|
||||
if (dbBatch.getEtd() != null) {
|
||||
etdStr = sdf.format(dbBatch.getEtd());
|
||||
}
|
||||
// 车牌号
|
||||
String carNo = batch.getCarNo() == null ? "" : batch.getCarNo();
|
||||
String carNo = dbBatch.getCarNo() == null ? "" : dbBatch.getCarNo();
|
||||
// 拼接batchName
|
||||
String batchName = prefix + startSiteCode3 + supplierNameEn + nextSiteCode3 + etdStr + carNo;
|
||||
batch.setBatchName(batchName);
|
||||
emisTmsSiteBatchService.updateEmisTmsSiteBatch(batch);
|
||||
dbBatch.setBatchName(batchName);
|
||||
emisTmsSiteBatchService.updateEmisTmsSiteBatch(dbBatch);
|
||||
}
|
||||
return AjaxResult.success("批量修改成功");
|
||||
}
|
||||
|
||||
@ -190,7 +190,8 @@
|
||||
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
||||
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</if>
|
||||
<if test="updateSite != null and updateSite != ''"> and update_site=#{updateSite}</if>
|
||||
<if test="blEntering != null and blEntering != ''"> and bl_entering=#{blEntering}</if>
|
||||
<if test="blEntering==1"> and bl_entering=#{blEntering}</if>
|
||||
<if test="blEntering==-1"> and bl_entering='0'</if>
|
||||
|
||||
<if test="searchValue != null and searchValue != '' ">
|
||||
and ( batch_no like concat('%', #{searchValue},'%') or batch_name like concat('%', #{searchValue},'%') or car_no like concat('%', #{searchValue},'%') )
|
||||
@ -265,7 +266,8 @@
|
||||
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
||||
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</if>
|
||||
<if test="updateSite != null and updateSite != ''"> and update_site=#{updateSite}</if>
|
||||
<if test="blEntering != null and blEntering != ''"> and bl_entering=#{blEntering}</if>
|
||||
<if test="blEntering==1"> and bl_entering=#{blEntering}</if>
|
||||
<if test="blEntering==-1"> and bl_entering='0'</if>
|
||||
|
||||
<if test="searchValue != null and searchValue != '' ">
|
||||
and ( batch_no like concat('%', #{searchValue},'%') or batch_name like concat('%', #{searchValue},'%') or car_no like concat('%', #{searchValue},'%') )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user