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");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||||
for (EmisTmsSiteBatch batch : batchList) {
|
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";
|
String prefix = "E";
|
||||||
if (batch.getTransType() != null) {
|
if (dbBatch.getTransType() != null) {
|
||||||
switch (batch.getTransType()) {
|
switch (dbBatch.getTransType()) {
|
||||||
case "1":
|
case "1":
|
||||||
prefix = "E";
|
prefix = "E";
|
||||||
break;
|
break;
|
||||||
@ -260,9 +286,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
|||||||
}
|
}
|
||||||
// 起始网点三字码
|
// 起始网点三字码
|
||||||
String startSiteCode3 = "";
|
String startSiteCode3 = "";
|
||||||
if (batch.getStartSiteCode() != null) {
|
if (dbBatch.getStartSiteCode() != null) {
|
||||||
EmisSite startSite = new EmisSite();
|
EmisSite startSite = new EmisSite();
|
||||||
startSite.setSiteCode(batch.getStartSiteCode());
|
startSite.setSiteCode(dbBatch.getStartSiteCode());
|
||||||
List<EmisSite> startSites = emisSiteService.selectEmisSiteList(startSite);
|
List<EmisSite> startSites = emisSiteService.selectEmisSiteList(startSite);
|
||||||
if (!CollectionUtils.isEmpty(startSites)) {
|
if (!CollectionUtils.isEmpty(startSites)) {
|
||||||
startSiteCode3 = startSites.get(0).getSizeCode3();
|
startSiteCode3 = startSites.get(0).getSizeCode3();
|
||||||
@ -270,9 +296,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
|||||||
}
|
}
|
||||||
// 供应商英文名
|
// 供应商英文名
|
||||||
String supplierNameEn = "";
|
String supplierNameEn = "";
|
||||||
if (batch.getSupplierCode() != null) {
|
if (dbBatch.getSupplierCode() != null) {
|
||||||
EmisSupplier supplier = new EmisSupplier();
|
EmisSupplier supplier = new EmisSupplier();
|
||||||
supplier.setCode(batch.getSupplierCode());
|
supplier.setCode(dbBatch.getSupplierCode());
|
||||||
List<EmisSupplier> suppliers = emisSupplierService.selectEmisSupplierList(supplier);
|
List<EmisSupplier> suppliers = emisSupplierService.selectEmisSupplierList(supplier);
|
||||||
if (!CollectionUtils.isEmpty(suppliers)) {
|
if (!CollectionUtils.isEmpty(suppliers)) {
|
||||||
supplierNameEn = suppliers.get(0).getNameEn();
|
supplierNameEn = suppliers.get(0).getNameEn();
|
||||||
@ -280,9 +306,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
|||||||
}
|
}
|
||||||
// 下一网点三字码
|
// 下一网点三字码
|
||||||
String nextSiteCode3 = "";
|
String nextSiteCode3 = "";
|
||||||
if (batch.getNextSiteCode() != null) {
|
if (dbBatch.getNextSiteCode() != null) {
|
||||||
EmisSite nextSite = new EmisSite();
|
EmisSite nextSite = new EmisSite();
|
||||||
nextSite.setSiteCode(batch.getNextSiteCode());
|
nextSite.setSiteCode(dbBatch.getNextSiteCode());
|
||||||
List<EmisSite> nextSites = emisSiteService.selectEmisSiteList(nextSite);
|
List<EmisSite> nextSites = emisSiteService.selectEmisSiteList(nextSite);
|
||||||
if (!CollectionUtils.isEmpty(nextSites)) {
|
if (!CollectionUtils.isEmpty(nextSites)) {
|
||||||
nextSiteCode3 = nextSites.get(0).getSizeCode3();
|
nextSiteCode3 = nextSites.get(0).getSizeCode3();
|
||||||
@ -290,15 +316,15 @@ public class EmisTmsSiteBatchController extends EmisBaseController
|
|||||||
}
|
}
|
||||||
// etd日期
|
// etd日期
|
||||||
String etdStr = "";
|
String etdStr = "";
|
||||||
if (batch.getEtd() != null) {
|
if (dbBatch.getEtd() != null) {
|
||||||
etdStr = sdf.format(batch.getEtd());
|
etdStr = sdf.format(dbBatch.getEtd());
|
||||||
}
|
}
|
||||||
// 车牌号
|
// 车牌号
|
||||||
String carNo = batch.getCarNo() == null ? "" : batch.getCarNo();
|
String carNo = dbBatch.getCarNo() == null ? "" : dbBatch.getCarNo();
|
||||||
// 拼接batchName
|
// 拼接batchName
|
||||||
String batchName = prefix + startSiteCode3 + supplierNameEn + nextSiteCode3 + etdStr + carNo;
|
String batchName = prefix + startSiteCode3 + supplierNameEn + nextSiteCode3 + etdStr + carNo;
|
||||||
batch.setBatchName(batchName);
|
dbBatch.setBatchName(batchName);
|
||||||
emisTmsSiteBatchService.updateEmisTmsSiteBatch(batch);
|
emisTmsSiteBatchService.updateEmisTmsSiteBatch(dbBatch);
|
||||||
}
|
}
|
||||||
return AjaxResult.success("批量修改成功");
|
return AjaxResult.success("批量修改成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -190,7 +190,8 @@
|
|||||||
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
||||||
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</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="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 != '' ">
|
<if test="searchValue != null and searchValue != '' ">
|
||||||
and ( batch_no like concat('%', #{searchValue},'%') or batch_name like concat('%', #{searchValue},'%') or car_no like concat('%', #{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="updateTime != null "> and update_time = #{updateTime}</if>
|
||||||
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</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="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 != '' ">
|
<if test="searchValue != null and searchValue != '' ">
|
||||||
and ( batch_no like concat('%', #{searchValue},'%') or batch_name like concat('%', #{searchValue},'%') or car_no like concat('%', #{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