Commit 64ff60e9 authored by 顾俭's avatar 顾俭

Merge branch '#4' into 'master'

aship/aship#4 防伪码功能-送货审核

See merge request !6
parents aff97361 05cae4a3
...@@ -100,7 +100,9 @@ public class DeliveryOrderSendService implements IDeliveryOrderSendService { ...@@ -100,7 +100,9 @@ public class DeliveryOrderSendService implements IDeliveryOrderSendService {
Detail detail = Detail.of(doXmlDtlRecordList, "DTL"); Detail detail = Detail.of(doXmlDtlRecordList, "DTL");
doXmlDetailList.add(detail); doXmlDetailList.add(detail);
// 启用防伪码供应商没有箱标签dtl1
//Detail1 //Detail1
if(!"Y".equals(doMstFile.getSupplier().getUseBarcode())) {
List<DoDtlProductLabelFile> doDtlProductLabelFileList = doDtlProductLabelFileDao.findAllByDoMstId(doMstId); List<DoDtlProductLabelFile> doDtlProductLabelFileList = doDtlProductLabelFileDao.findAllByDoMstId(doMstId);
List<Record> doXmlDtl1RecordList = new ArrayList<>(); List<Record> doXmlDtl1RecordList = new ArrayList<>();
if (!doDtlProductLabelFileList.isEmpty()) { if (!doDtlProductLabelFileList.isEmpty()) {
...@@ -142,7 +144,7 @@ public class DeliveryOrderSendService implements IDeliveryOrderSendService { ...@@ -142,7 +144,7 @@ public class DeliveryOrderSendService implements IDeliveryOrderSendService {
} }
Detail detail1 = Detail.of(doXmlDtl1RecordList, "DTL1"); Detail detail1 = Detail.of(doXmlDtl1RecordList, "DTL1");
doXmlDetailList.add(detail1); doXmlDetailList.add(detail1);
}
RecordSet recordSet = RecordSet.of(String.valueOf(i + 1), mst, doXmlDetailList); RecordSet recordSet = RecordSet.of(String.valueOf(i + 1), mst, doXmlDetailList);
recordSetList.add(recordSet); recordSetList.add(recordSet);
} else { } else {
......
...@@ -14,12 +14,9 @@ import org.slf4j.Logger; ...@@ -14,12 +14,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tw.com.dsc.tiptop.tiptopservicegateway.SRMFahuoRequestSRMFahuoRequest; import tw.com.dsc.tiptop.tiptopservicegateway.*;
import tw.com.dsc.tiptop.tiptopservicegateway.SRMFahuoResponseSRMFahuoResponse;
import tw.com.dsc.tiptop.tiptopservicegateway.TIPTOPServiceGateWayPortType;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -43,6 +40,12 @@ public class DeliveryOrderSendClient extends WebServiceClient { ...@@ -43,6 +40,12 @@ public class DeliveryOrderSendClient extends WebServiceClient {
@Value("${srm.soapWs.wsUrl}") @Value("${srm.soapWs.wsUrl}")
private String WS_URL; private String WS_URL;
@Value("${srm.soapWs.fahuoConfirm}")
public String ERP_FAHUO_CONFIRM_OP;
@Value("${srm.soapWs.wsdlUrl}")
private String WSDL_URL;
private Logger logger = LoggerFactory.getLogger(DeliveryOrderSendClient.class); private Logger logger = LoggerFactory.getLogger(DeliveryOrderSendClient.class);
@Autowired @Autowired
...@@ -57,7 +60,7 @@ public class DeliveryOrderSendClient extends WebServiceClient { ...@@ -57,7 +60,7 @@ public class DeliveryOrderSendClient extends WebServiceClient {
/** /**
* Send released delivery orders to ERP every one min. * Send released delivery orders to ERP every one min.
*/ */
@Scheduled(fixedDelay = 3600000) // @Scheduled(fixedDelay = 3600000)
@Transactional @Transactional
public void autoSend() throws IOneServiceException { public void autoSend() throws IOneServiceException {
try { try {
...@@ -126,6 +129,24 @@ public class DeliveryOrderSendClient extends WebServiceClient { ...@@ -126,6 +129,24 @@ public class DeliveryOrderSendClient extends WebServiceClient {
} }
} }
// 防伪码审核发货 只有动态客户端
@Transactional
public SyncResponse createClientAndSendDoMstFileBarcode(DoMstFile doMstFile) {
try {
if (StringUtils.isBlank(WSDL_URL) || StringUtils.isBlank(ERP_FAHUO_CONFIRM_OP)) {
throw new IOneServiceException("WSDL_URL or ERP_FAHUO_CONFIRM_OP 不可为空");
} else {
Client client = getClient(WSDL_URL);
SyncResponse syncResponse = sendDoMstFileBarcode(doMstFile, client);
client.destroy();
return syncResponse;
}
} catch (Exception e) {
logger.error("error", e);
return SyncResponse.of(FAIL_CODE, e.getMessage());
}
}
@Transactional @Transactional
public SyncResponse sendDoMstFile1(DoMstFile doMstFile, Client client) { public SyncResponse sendDoMstFile1(DoMstFile doMstFile, Client client) {
try { try {
...@@ -151,6 +172,30 @@ public class DeliveryOrderSendClient extends WebServiceClient { ...@@ -151,6 +172,30 @@ public class DeliveryOrderSendClient extends WebServiceClient {
} }
} }
@Transactional
public SyncResponse sendDoMstFileBarcode(DoMstFile doMstFile, Client client) {
try {
SRMFahuoconfirmRequestSRMFahuoconfirmRequest request = prepareRequestBarcode(doMstFile);
Object[] objects;
try {
// 防伪码审核
objects = client.invoke(ERP_FAHUO_CONFIRM_OP, new Object[]{request});
} catch (Exception e) {
throw new IOneServiceException(e);
}
if (objects != null && objects.length > 0) {
logger.info(objects[0].toString());
SRMFahuoconfirmResponseSRMFahuoconfirmResponse originalResponse = (SRMFahuoconfirmResponseSRMFahuoconfirmResponse) objects[0];
return handleResponseBarcode(originalResponse, doMstFile);
} else {
updateSendToErpStatus(doMstFile, false, "ERP无响应.");
return SyncResponse.of(FAIL_CODE, "ERP无响应");
}
} catch (IOneServiceException e) {
return SyncResponse.of(FAIL_CODE, e.getMessage());
}
}
@Transactional @Transactional
public SyncResponse sendDoMstFile2(DoMstFile doMstFile) { public SyncResponse sendDoMstFile2(DoMstFile doMstFile) {
try { try {
...@@ -180,6 +225,21 @@ public class DeliveryOrderSendClient extends WebServiceClient { ...@@ -180,6 +225,21 @@ public class DeliveryOrderSendClient extends WebServiceClient {
return srmFahuoRequest; return srmFahuoRequest;
} }
@Transactional
public SRMFahuoconfirmRequestSRMFahuoconfirmRequest prepareRequestBarcode(DoMstFile doMstFile) throws IOneServiceException {
Request xml;
xml = deliveryOrderSendService.sendDoXml(Arrays.asList(doMstFile.getId()));
if (xml == null) {
updateSendToErpStatus(doMstFile, false, "无法生成XML结构.");
throw new IOneServiceException("无法生成XML结构");
}
SRMFahuoconfirmRequestSRMFahuoconfirmRequest request = new SRMFahuoconfirmRequestSRMFahuoconfirmRequest();
request.setRequest(covertObjectToXML(xml, Request.class));
logger.info(request.getRequest());
return request;
}
@Transactional @Transactional
public SyncResponse handleResponse(SRMFahuoResponseSRMFahuoResponse originalResponse, DoMstFile doMstFile) { public SyncResponse handleResponse(SRMFahuoResponseSRMFahuoResponse originalResponse, DoMstFile doMstFile) {
try { try {
...@@ -202,6 +262,28 @@ public class DeliveryOrderSendClient extends WebServiceClient { ...@@ -202,6 +262,28 @@ public class DeliveryOrderSendClient extends WebServiceClient {
} }
} }
@Transactional
public SyncResponse handleResponseBarcode(SRMFahuoconfirmResponseSRMFahuoconfirmResponse originalResponse, DoMstFile doMstFile) {
try {
logger.info(originalResponse.getResponse());
Response response = convertXMLToObject(originalResponse.getResponse(), Response.class);
if (response.getExecution().getStatus().getCode().equalsIgnoreCase("0")) {
updateSendToErpStatus(doMstFile, false, "提交审核成功");
return SyncResponse.of(SUCCESS_CODE, "提交审核成功");
} else {
String errorDetails = String.format("失败码:%s, 原因:%s,SQL:%s",
safeString(response.getExecution().getStatus().getCode()),
safeString(response.getExecution().getStatus().getDescription()),
safeString(response.getExecution().getStatus().getSqlcode()));
updateSendToErpStatus(doMstFile, false, errorDetails);
return SyncResponse.of(FAIL_CODE, errorDetails);
}
} catch (IOneServiceException e) {
return SyncResponse.of(FAIL_CODE, e.getMessage());
}
}
@Transactional @Transactional
public void updateSendToErpStatus(DoMstFile doMstFile, Boolean status, String details) throws IOneServiceException { public void updateSendToErpStatus(DoMstFile doMstFile, Boolean status, String details) throws IOneServiceException {
logger.info("DeliveryOrderSendClient-updateSendToErpStatus start,ID:{},DeliveryOrderUid:{},SentToErp:{},SentToErpInfo:{}", logger.info("DeliveryOrderSendClient-updateSendToErpStatus start,ID:{},DeliveryOrderUid:{},SentToErp:{},SentToErpInfo:{}",
...@@ -215,10 +297,6 @@ public class DeliveryOrderSendClient extends WebServiceClient { ...@@ -215,10 +297,6 @@ public class DeliveryOrderSendClient extends WebServiceClient {
doMstFileNew.getId(), doMstFileNew.getDeliveryOrderUid(), doMstFileNew.getSentToErp(), doMstFileNew.getSentToErpInfo()); doMstFileNew.getId(), doMstFileNew.getDeliveryOrderUid(), doMstFileNew.getSentToErp(), doMstFileNew.getSentToErpInfo());
String info = details + "ID: " + doMstFile.getId() + "DeliveryOrderUid: " + doMstFile.getDeliveryOrderUid(); String info = details + "ID: " + doMstFile.getId() + "DeliveryOrderUid: " + doMstFile.getDeliveryOrderUid();
if (!status) {
logger.error(info);
} else {
logger.info(info); logger.info(info);
} }
}
} }
\ No newline at end of file
...@@ -49,16 +49,21 @@ public class DoMstFileController extends AbstractController<DoMstFile, DoMstFile ...@@ -49,16 +49,21 @@ public class DoMstFileController extends AbstractController<DoMstFile, DoMstFile
@RequestMapping(value = "/release/{id}", method = RequestMethod.POST) @RequestMapping(value = "/release/{id}", method = RequestMethod.POST)
public SyncResponse release(@PathVariable Long id) throws IOneWebRestfulException { public SyncResponse release(@PathVariable Long id) throws IOneWebRestfulException {
try { try {
SyncResponse response;
DoMstFile doMstFile = service.get(id); DoMstFile doMstFile = service.get(id);
service.passOnlyUnreleased(doMstFile); service.passOnlyUnreleased(doMstFile);
if(doMstFile.getSentToErp()) { if (doMstFile.getSentToErp()) {
throw new IOneServiceException("该送货单已经同步成功,请重新获取查看"); throw new IOneServiceException("该送货单已经同步成功,请重新获取查看");
} }
if ("Y".equals(doMstFile.getSupplier().getUseBarcode())) {
response = deliveryOrderSendClient.createClientAndSendDoMstFileBarcode(doMstFile);
} else {
service.release(doMstFile); service.release(doMstFile);
SyncResponse response = deliveryOrderSendClient.createClientAndSendDoMstFile(doMstFile); response = deliveryOrderSendClient.createClientAndSendDoMstFile(doMstFile);
if (response != null && response.getCode().equals(FAIL_CODE)) { if (response != null && response.getCode().equals(FAIL_CODE)) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
} }
}
return response; return response;
} catch (IOneServiceException e) { } catch (IOneServiceException e) {
throw new IOneWebRestfulException(e); throw new IOneWebRestfulException(e);
...@@ -85,8 +90,13 @@ public class DoMstFileController extends AbstractController<DoMstFile, DoMstFile ...@@ -85,8 +90,13 @@ public class DoMstFileController extends AbstractController<DoMstFile, DoMstFile
@ResourcePermission(values={Resource.VIEW}) @ResourcePermission(values={Resource.VIEW})
@RequestMapping(value = "/checkDeliveryAmt/{id}", method = RequestMethod.GET) @RequestMapping(value = "/checkDeliveryAmt/{id}", method = RequestMethod.GET)
public Map getTest(@PathVariable Long id) throws IOneWebRestfulException { public Map checkDeliveryAmt(@PathVariable Long id) throws IOneWebRestfulException {
try { try {
// 防伪码没有生成箱标签
if ("Y".equals(service.get(id).getSupplier().getUseBarcode())) {
return ImmutableMap.of("message", "success");
}
List<Object[]> rows = service.checkDeliveryAmtByDoMstId(id); List<Object[]> rows = service.checkDeliveryAmtByDoMstId(id);
if (rows.size() > 0) { if (rows.size() > 0) {
String msg = ""; String msg = "";
......
...@@ -157,17 +157,26 @@ ...@@ -157,17 +157,26 @@
resource=" 'DELETE' ">删除 resource=" 'DELETE' ">删除
</button> </button>
<button class="btn btn-default mrs" ng-click="createLabel()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrderDetails.size == 0" <button class="btn btn-default mrs" ng-click="createLabel()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrderDetails.size == 0"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'CREATE_LABEL' ">创建箱标签 acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'CREATE_LABEL' "
ng-if="queryCondition.poMst.supplier && queryCondition.poMst.supplier.useBarcode != 'Y'">创建箱标签
</button> </button>
<button class="btn btn-default mrs" ng-click="openSteelCoilOrNotDlg()" <button class="btn btn-default mrs" ng-click="openSteelCoilOrNotDlg()"
ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrderDetails.size == 0" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrderDetails.size == 0"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'UPDATE_LABEL' ">修改箱标签 acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'UPDATE_LABEL' "
ng-if="queryCondition.poMst.supplier && queryCondition.poMst.supplier.useBarcode != 'Y'">修改箱标签
</button> </button>
<button class="btn btn-default mrs" ng-click="release()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || uiOption.releasing" <button class="btn btn-default mrs" ng-click="release()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || uiOption.releasing"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'RELEASE' ">发布 acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'RELEASE' "
ng-if="queryCondition.poMst.supplier.useBarcode !== 'Y'">发布
</button> </button>
<button class="btn btn-default mrs" ng-click="unrelease()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '0' || uiOption.unReleasing" <button class="btn btn-default mrs" ng-click="unrelease()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '0' || uiOption.unReleasing"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'UNDO_RELEASE' ">发布撤回 acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'UNDO_RELEASE' "
ng-if="queryCondition.poMst.supplier.useBarcode !== 'Y'">发布撤回
</button>
<button class="btn btn-default mrs" ng-click="release()"
ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || uiOption.releasing"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'RELEASE' "
ng-if="queryCondition.poMst.supplier.useBarcode === 'Y'">审核
</button> </button>
<button class="btn btn-default mrs" ng-click="clickExport()" ng-disabled="gridOptions.data.length == 0" <button class="btn btn-default mrs" ng-click="clickExport()" ng-disabled="gridOptions.data.length == 0"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'EXPORT' ">导出 acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'EXPORT' ">导出
......
...@@ -59,7 +59,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco ...@@ -59,7 +59,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
name: '操作', field: "doMst.deliveryOrderUid", name: '操作', field: "doMst.deliveryOrderUid",
cellTemplate: "<a ng-if='row.entity.doMst.released == \"1\"' href ng-click='grid.appScope.printDeliveryOrder(row.entity)' title='打印送货单'><i class='fa fa-print'></i></a> " + cellTemplate: "<a ng-if='row.entity.doMst.released == \"1\"' href ng-click='grid.appScope.printDeliveryOrder(row.entity)' title='打印送货单'><i class='fa fa-print'></i></a> " +
"<a ng-if='row.entity.doMst.released == \"1\"' href style='margin-left: 5px;' ng-click='grid.appScope.printDeliveryOrderLabels(row.entity)' title='打印箱A4版标签'><i class='fa fa-print'></i></a>" + "<a ng-if='row.entity.doMst.released == \"1\"' href style='margin-left: 5px;' ng-click='grid.appScope.printDeliveryOrderLabels(row.entity)' title='打印箱A4版标签'><i class='fa fa-print'></i></a>" +
"<a ng-if='row.entity.doMst.released == \"1\"' href style='margin-left: 10px;' ng-click='grid.appScope.printDeliveryOrderSingleLabel(row.entity)' title='打印箱条码标签'><i class='fa fa-print'></i></a>", "<a ng-if='row.entity.doMst.released == \"1\" && row.entity.doMst.supplier.useBarcode != \"Y\"' href style='margin-left: 10px;' ng-click='grid.appScope.printDeliveryOrderSingleLabel(row.entity)' title='打印箱条码标签'><i class='fa fa-print'></i></a>",
width: 100, cellClass: 'print-icon' width: 100, cellClass: 'print-icon'
}, },
{name: '送货单号', field: 'doMst.deliveryOrderUid', width: 120, cellTemplate: cellTemplate}, {name: '送货单号', field: 'doMst.deliveryOrderUid', width: 120, cellTemplate: cellTemplate},
...@@ -166,7 +166,8 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco ...@@ -166,7 +166,8 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
if ($scope.queryCondition.poMst.supplier.id) { if ($scope.queryCondition.poMst.supplier.id) {
$scope.queryCondition.poMst.supplier = { $scope.queryCondition.poMst.supplier = {
id: $scope.queryCondition.poMst.supplier.id, id: $scope.queryCondition.poMst.supplier.id,
name: $scope.queryCondition.poMst.supplier.name name: $scope.queryCondition.poMst.supplier.name,
useBarcode: $scope.queryCondition.poMst.supplier.useBarcode
}; };
} }
...@@ -204,12 +205,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco ...@@ -204,12 +205,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
return ($scope.pageOption.page - 1) * $scope.pageOption.size + index + 1; return ($scope.pageOption.page - 1) * $scope.pageOption.size + index + 1;
}; };
if (item.doMst.sentToErp == false && item.doMst.sentToErpInfo == null) { item.doMst.sentToErpStatus = item.doMst.sentToErp ? '已同步' : '未同步';
item.doMst.sentToErpInfo = '无法连接ERP或等待下一个同步周期.';
item.doMst.sentToErpStatus = '未同步'
} else {
item.doMst.sentToErpStatus = item.doMst.sentToErp ? '成功' : '失败';
}
}) })
}; };
...@@ -320,6 +316,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco ...@@ -320,6 +316,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
return; return;
} }
if ($scope.queryCondition.poMst.supplier.useBarcode !== 'Y') {
if (results[1].data.length == 0) { if (results[1].data.length == 0) {
UtilService.showError("未生成箱标签,无法发布。请创建箱标签。"); UtilService.showError("未生成箱标签,无法发布。请创建箱标签。");
$scope.uiOption.releasing = false; $scope.uiOption.releasing = false;
...@@ -339,33 +336,27 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco ...@@ -339,33 +336,27 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
return; return;
} }
} }
}
DoMstFileService.checkDeliveryAmt($scope.currentDeliveryOrder.id).then(function (checkResponse) { DoMstFileService.checkDeliveryAmt($scope.currentDeliveryOrder.id).then(function (checkResponse) {
if (checkResponse.data.message == 'success') { if (checkResponse.data.message == 'success') {
DoMstFileService.release($scope.currentDeliveryOrder.id).then(function (releaseResponse) { DoMstFileService.release($scope.currentDeliveryOrder.id).then(function (releaseResponse) {
if (releaseResponse.data.code == '0') { if (releaseResponse.data.code == '0') {
UtilService.showInfo("发布成功。"); UtilService.showInfo("成功。");
angular.forEach($scope.gridOptions.data, function (item) {
if (item.doMst.deliveryOrderUid === $scope.currentDeliveryOrder.deliveryOrderUid) {
item.doMst.released = '1';
item.doMst.releasedDate = new Date();
item.doMst.sentToErpStatus = '成功';
item.doMst.sentToErpInfo = '同步ERP成功';
}
});
$scope.uiOption.releasing = false; $scope.uiOption.releasing = false;
$scope.queryDeliveryOrderDetails();
} else { } else {
UtilService.showError("发布失败:<br>" + releaseResponse.data.message); UtilService.showError("失败:<br>" + releaseResponse.data.message);
$scope.uiOption.releasing = false; $scope.uiOption.releasing = false;
$scope.queryDeliveryOrderDetails(); $scope.queryDeliveryOrderDetails();
} }
}, function (releaseError) { }, function (releaseError) {
UtilService.showError("发布失败:<br>" + (releaseError.data.externalError || releaseError.data.error)); UtilService.showError("失败:<br>" + (releaseError.data.externalError || releaseError.data.error));
$scope.uiOption.releasing = false; $scope.uiOption.releasing = false;
$scope.queryDeliveryOrderDetails(); $scope.queryDeliveryOrderDetails();
}) })
} else { } else {
UtilService.showError("发布失败:<br>" + checkResponse.data.message); UtilService.showError("失败:<br>" + checkResponse.data.message);
$scope.uiOption.releasing = false; $scope.uiOption.releasing = false;
} }
}, function () { }, function () {
...@@ -396,7 +387,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco ...@@ -396,7 +387,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
item.doMst.printer = null; item.doMst.printer = null;
item.doMst.sentToErp = false; item.doMst.sentToErp = false;
item.doMst.sentToErpStatus = '未同步'; item.doMst.sentToErpStatus = '未同步';
item.doMst.sentToErpInfo = '无法连接ERP或等待下一个同步周期.'; item.doMst.sentToErpInfo = '';
} }
}); });
} else { } else {
...@@ -416,12 +407,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco ...@@ -416,12 +407,7 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
$scope.clickExport = function () { $scope.clickExport = function () {
DoDtlFileService.getAllByExample($scope.queryCondition).then(function (response) { DoDtlFileService.getAllByExample($scope.queryCondition).then(function (response) {
var jsonData = response.data.map(function (item, index) { var jsonData = response.data.map(function (item, index) {
if (item.doMst.sentToErp == false && item.doMst.sentToErpInfo == null) { item.doMst.sentToErpStatus = item.doMst.sentToErp ? '已同步' : '未同步';
item.doMst.sentToErpInfo = '无法连接ERP或等待下一个同步周期.';
item.doMst.sentToErpStatus = '未同步'
} else {
item.doMst.sentToErpStatus = item.doMst.sentToErp ? '成功' : '失败';
}
return { return {
index: index + 1, index: index + 1,
deliveryOrderUid: item.doMst.deliveryOrderUid || ' ', deliveryOrderUid: item.doMst.deliveryOrderUid || ' ',
......
...@@ -49,9 +49,15 @@ ...@@ -49,9 +49,15 @@
<!--ng-if="uiOption.currentStatus == uiStatus.CREATE_LABEL && op == 'MODIFY' && isSteelCoil()"--> <!--ng-if="uiOption.currentStatus == uiStatus.CREATE_LABEL && op == 'MODIFY' && isSteelCoil()"-->
<!--ng-disabled="!updateDeliveryOrderForm.$valid">保存</button>--> <!--ng-disabled="!updateDeliveryOrderForm.$valid">保存</button>-->
<button class="btn btn-default mrs" ng-click="saveDeliveryOrderProductList(true)" <button class="btn btn-default mrs" ng-click="saveDeliveryOrderProductList(true)"
ng-if="uiOption.currentStatus == uiStatus.CREATE_LABEL" ng-if="uiOption.currentStatus == uiStatus.CREATE_LABEL && (currentDeliveryOrder.supplier.useBarcode !='Y')"
ng-disabled="!updateDeliveryOrderForm.$valid">保存并创建箱标签 ng-disabled="!updateDeliveryOrderForm.$valid">保存并创建箱标签
</button> </button>
<!--启用防伪码供应商useBarcode不创建箱标签-->
<button class="btn btn-default mrs" ng-click="saveDeliveryOrderProductList(false)"
ng-if="(uiOption.currentStatus == uiStatus.CREATE_LABEL) && (currentDeliveryOrder.supplier.useBarcode =='Y')"
ng-disabled="!updateDeliveryOrderForm.$valid">保存
</button>
</div> </div>
</div> </div>
......
...@@ -689,7 +689,8 @@ angular.module('IOne').controller('DeliveryOrderUpdateController', function ($ro ...@@ -689,7 +689,8 @@ angular.module('IOne').controller('DeliveryOrderUpdateController', function ($ro
} }
//check if the steel coil amount has been changed //check if the steel coil amount has been changed
if (!generateLabel) { // barcode不产生箱标签修改 && $scope.deliveryOrderAggregationGridOptions.data[0].steelCoil == '1'
if (!generateLabel && $scope.deliveryOrderAggregationGridOptions.data[0].steelCoil == '1') {
DoDtlProductLabelFileService.getAllByExample({ DoDtlProductLabelFileService.getAllByExample({
doMst: {id: $scope.currentDeliveryOrderId} doMst: {id: $scope.currentDeliveryOrderId}
}).then(function (response) { }).then(function (response) {
......
...@@ -75,8 +75,10 @@ ...@@ -75,8 +75,10 @@
<div class="button-bar"> <div class="button-bar">
<button class="btn btn-primary" ng-click="printDeliveryOrder()" ng-disabled="currentDeliveryOrder.released !='1'">打印送货单</button> <button class="btn btn-primary" ng-click="printDeliveryOrder()" ng-disabled="currentDeliveryOrder.released !='1'">打印送货单</button>
<button class="btn btn-primary" ng-click="printDeliveryOrderLabels()" ng-disabled="productGridOption.data.length == 0 || currentDeliveryOrder.released !='1'">打印A4标签</button> <button class="btn btn-primary" ng-click="printDeliveryOrderLabels()" ng-disabled="productGridOption.data.length == 0 || currentDeliveryOrder.released !='1'">打印A4标签</button>
<button class="btn btn-primary" ng-click="printDeliveryOrderSingleLabel()" ng-disabled="productGridOption.data.length == 0 || currentDeliveryOrder.released !='1'">打印条码标签</button> <button class="btn btn-primary" ng-click="printDeliveryOrderSingleLabel()" ng-disabled="productGridOption.data.length == 0 || currentDeliveryOrder.released !='1'"
<button class="btn btn-primary" ng-click="saveLabels()" ng-hide="labelGridOption.data.length == 0 || labelGridOption.data[0].doDtlProduct.steelCoil == '0'" ng-if="currentDeliveryOrder.supplier.useBarcode !=='Y'">打印条码标签
</button>
<button class=" btn btn-primary" ng-click="saveLabels()" ng-hide="labelGridOption.data.length == 0 || labelGridOption.data[0].doDtlProduct.steelCoil == '0'"
ng-disabled="currentDeliveryOrder.released =='1'" ng-disabled="currentDeliveryOrder.released =='1'"
ng-if="false">保存钢卷信息 ng-if="false">保存钢卷信息
</button> </button>
...@@ -90,7 +92,8 @@ ...@@ -90,7 +92,8 @@
<uib-tab index="1" heading="订单物料汇总"> <uib-tab index="1" heading="订单物料汇总">
<div ui-grid="productGridOption" ui-grid-selection ui-grid-resize-columns class="grid mts"></div> <div ui-grid="productGridOption" ui-grid-selection ui-grid-resize-columns class="grid mts"></div>
</uib-tab> </uib-tab>
<uib-tab index="2" heading="箱标签明细"> <uib-tab index="2" heading="箱标签明细"
ng-if="currentDeliveryOrder.supplier.useBarcode!='Y'">
<div ui-grid="labelGridOption" ui-grid-selection ui-grid-edit ui-grid-row-edit ui-grid-cellNav ui-grid-resize-columns class="grid mts"></div> <div ui-grid="labelGridOption" ui-grid-selection ui-grid-edit ui-grid-row-edit ui-grid-cellNav ui-grid-resize-columns class="grid mts"></div>
</uib-tab> </uib-tab>
</uib-tabset> </uib-tabset>
......
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