Commit 6d4881ab authored by 顾俭's avatar 顾俭

新增送货单防伪码审核状态和已审核管控

parent cc9cc439
......@@ -23,6 +23,8 @@ import java.util.List;
import static com.i1.erp.base.web.dto.SyncResponseCode.FAIL_CODE;
import static com.i1.erp.base.web.dto.SyncResponseCode.SUCCESS_CODE;
import static com.i1.srm.deliveryOrder.dao.entity.DoMstFile.CONFIRMED;
import static com.i1.srm.deliveryOrder.dao.entity.DoMstFile.UNCONFIRMED;
import static com.i1.srm.utils.SafeType.safeString;
@Component
......@@ -269,14 +271,14 @@ public class DeliveryOrderSendClient extends WebServiceClient {
Response response = convertXMLToObject(originalResponse.getResponse(), Response.class);
if (response.getExecution().getStatus().getCode().equalsIgnoreCase("0")) {
updateSendToErpStatus(doMstFile, false, "提交审核成功");
updateConfirm(doMstFile, CONFIRMED, "提交审核成功");
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);
updateConfirm(doMstFile, UNCONFIRMED, errorDetails);
return SyncResponse.of(FAIL_CODE, errorDetails);
}
} catch (IOneServiceException e) {
......@@ -299,4 +301,11 @@ public class DeliveryOrderSendClient extends WebServiceClient {
String info = details + "ID: " + doMstFile.getId() + "DeliveryOrderUid: " + doMstFile.getDeliveryOrderUid();
logger.info(info);
}
@Transactional
public void updateConfirm(DoMstFile doMstFile, String confirm, String details) throws IOneServiceException {
doMstFile.setConfirm(confirm);
doMstFile.setSentToErpInfo(details);
doMstFileService.update(doMstFile);
}
}
\ No newline at end of file
......@@ -22,6 +22,9 @@ public class DoMstFile extends IdentifiableObject {
public static final String UNPRINTED = "0";
public static final String PRINTED = "1";
public static final String UNCONFIRMED = "0";
public static final String CONFIRMED = "1";
private String deliveryOrderUid;
@ManyToOne(cascade = CascadeType.REFRESH)
......@@ -58,6 +61,7 @@ public class DoMstFile extends IdentifiableObject {
private Boolean sentToErp;
private String sentToErpInfo;
private String undoRelease;
private String confirm;
public BaseDictFile getPurchaseTypeDict() {
return purchaseTypeDict;
......@@ -292,4 +296,14 @@ public class DoMstFile extends IdentifiableObject {
public void setUndoRelease(String undoRelease) {
this.undoRelease = undoRelease;
}
@Basic
@Column(name = "CONFIRM", length = 1)
public String getConfirm() {
return confirm;
}
public void setConfirm(String confirm) {
this.confirm = confirm;
}
}
......@@ -80,6 +80,7 @@ public class DoMstFileService extends AbstractService<DoMstFile> implements IDoM
@Override
public DoMstFile initialDoMstFile(DoMstFile doMstFile, PoMstFile poMstFile) throws IOneServiceException {
if(doMstFile != null) {
doMstFile.setConfirm("0");
doMstFile.setReleased("0");
doMstFile.setPrinted("0");
doMstFile.setDeleted("0");
......@@ -148,6 +149,7 @@ public class DoMstFileService extends AbstractService<DoMstFile> implements IDoM
}
}
doMstFile.setConfirm(DoMstFile.CONFIRMED);
doMstFile.setReleased(DoMstFile.RELEASED);
doMstFile.setReleasedDate(new Date());
doMstFile.setReleasor(accountService.getCurrentUser());
......@@ -299,6 +301,7 @@ public class DoMstFileService extends AbstractService<DoMstFile> implements IDoM
doMstFile.setPrintedDate(null);
doMstFile.setPrinter(null);
doMstFile.setConfirm(DoMstFile.UNCONFIRMED);
doMstFile.setReleased(DoMstFile.UNRELEASED);
doMstFile.setReleasedDate(null);
doMstFile.setReleasor(null);
......
......@@ -26,6 +26,7 @@ import java.util.List;
import java.util.Map;
import static com.i1.erp.base.web.dto.SyncResponseCode.FAIL_CODE;
import static com.i1.srm.deliveryOrder.dao.entity.DoMstFile.CONFIRMED;
@RestController
@RequestMapping("/deliveryOrders")
......@@ -55,7 +56,11 @@ public class DoMstFileController extends AbstractController<DoMstFile, DoMstFile
if (doMstFile.getSentToErp()) {
throw new IOneServiceException("该送货单已经同步成功,请重新获取查看");
}
// 防伪码 审核
if ("Y".equals(doMstFile.getSupplier().getUseBarcode())) {
if (CONFIRMED.equals(doMstFile.getConfirm())) {
throw new IOneServiceException("该送货单已经审核,请重新获取查看");
}
response = deliveryOrderSendClient.createClientAndSendDoMstFileBarcode(doMstFile);
} else {
service.release(doMstFile);
......
......@@ -34,6 +34,7 @@ public class DoMstFileDto extends Dto<DoMstFile> {
private Boolean sentToErp;
private String sentToErpInfo;
private String undoRelease;
private String confirm;
//ext
......@@ -261,4 +262,12 @@ public class DoMstFileDto extends Dto<DoMstFile> {
public void setDeliveryDateEnd(Date deliveryDateEnd) {
this.deliveryDateEnd = deliveryDateEnd;
}
public String getConfirm() {
return confirm;
}
public void setConfirm(String confirm) {
this.confirm = confirm;
}
}
......@@ -553,5 +553,11 @@ angular.module('IOne').constant('Constants', {
'INVOICE_OPERATION_OPINION': {
'0': '通过',
'1': '驳回'
},
'CONFIRM': {
'': '全部',
'1': '已审核',
'0': '未审核'
}
});
\ No newline at end of file
......@@ -149,19 +149,20 @@
<div class="button-bar">
<button class="btn btn-default mrs" ng-click="create()" acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'CREATE' ">新建</button>
<button class="btn btn-default mrs" ng-click="modify()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1'" acl-check func=" 'DELIVERY_ORDER_FUNCTION' "
resource=" 'UPDATE' ">修改
<button class="btn btn-default mrs" ng-click="modify()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrder.confirm == '1'"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'UPDATE' ">修改
</button>
<button class="btn btn-default mrs" ng-click="view()" ng-disabled="!currentDeliveryOrder" acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'VIEW' ">查看</button>
<button class="btn btn-default mrs" ng-click="delete()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1'" acl-check func=" 'DELIVERY_ORDER_FUNCTION' "
resource=" 'DELETE' ">删除
<button class="btn btn-default mrs" ng-click="delete()" ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrder.confirm == '1'"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'DELETE' ">删除
</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' || currentDeliveryOrder.confirm == '1' || currentDeliveryOrderDetails.size == 0"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'CREATE_LABEL' "
ng-if="queryCondition.poMst.supplier && queryCondition.poMst.supplier.useBarcode != 'Y'">创建箱标签
</button>
<button class="btn btn-default mrs" ng-click="openSteelCoilOrNotDlg()"
ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrderDetails.size == 0"
ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.released == '1' || currentDeliveryOrder.confirm == '1' || currentDeliveryOrderDetails.size == 0"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'UPDATE_LABEL' "
ng-if="queryCondition.poMst.supplier && queryCondition.poMst.supplier.useBarcode != 'Y'">修改箱标签
</button>
......@@ -174,7 +175,7 @@
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"
ng-disabled="!currentDeliveryOrder || currentDeliveryOrder.confirm == '1' || currentDeliveryOrder.released == '1' || uiOption.releasing"
acl-check func=" 'DELIVERY_ORDER_FUNCTION' " resource=" 'RELEASE' "
ng-if="queryCondition.poMst.supplier.useBarcode === 'Y'">审核
</button>
......
......@@ -57,15 +57,16 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
{name: '序号', field: 'getIndex()', width: 50, cellTemplate: cellTemplate},
{
name: '操作', field: "doMst.deliveryOrderUid",
cellTemplate: "<a ng-if='row.entity.doMst.released == \"1\" || row.entity.doMst.sentToErpInfo == \"提交审核成功\"' href ng-click='grid.appScope.printDeliveryOrder(row.entity)' title='打印送货单'><i class='fa fa-print'></i></a> " +
"<a ng-if='row.entity.doMst.released == \"1\" || row.entity.doMst.sentToErpInfo == \"提交审核成功\"' 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\" || row.entity.doMst.sentToErpInfo == \"提交审核成功\") && 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>",
cellTemplate: "<a ng-if='row.entity.doMst.released == \"1\" || row.entity.doMst.confirm == \"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\" || row.entity.doMst.confirm == \"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\" || row.entity.doMst.confirm == \"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'
},
{name: '送货单号', field: 'doMst.deliveryOrderUid', width: 120, cellTemplate: cellTemplate},
{name: '送货单项次', field: 'doDtlRow', width: 90, cellTemplate: cellTemplate},
{name: '采购单号', field: 'poMst.purchaseOrderUid', width: 110, cellTemplate: cellTemplate},
{name: '采购单项次', field: 'poDtl.poDtlRow', width: 90, cellTemplate: cellTemplate},
{name: '审核状态', field: 'getConfirm()', width: 80, cellTemplate: cellTemplate},
{name: '发布状态', field: 'getReleaseStatus()', width: 80, cellTemplate: cellTemplate},
{name: '供应商编号', field: 'poMst.supplier.supplierUid', width: 100, cellTemplate: cellTemplate},
{name: '供应商名称', field: 'poMst.supplier.name', width: 180, cellTemplate: cellTemplate},
......@@ -197,6 +198,10 @@ angular.module('IOne').controller('DeliveryOrderQueryController', function ($sco
return Constants.RELEASE_STATUS[item.doMst.released];
};
item.getConfirm = function () {
return Constants.CONFIRM[item.doMst.confirm];
};
item.getPrintStatus = function () {
return Constants.PRINT_STATUS[item.doMst.printed];
};
......
......@@ -73,9 +73,9 @@
</div>
<div class="button-bar">
<button class="btn btn-primary" ng-click="printDeliveryOrder()" ng-disabled="currentDeliveryOrder.released !='1' && currentDeliveryOrder.sentToErpInfo !='提交审核成功'">打印送货单</button>
<button class="btn btn-primary" ng-click="printDeliveryOrderLabels()" ng-disabled="productGridOption.data.length == 0 || (currentDeliveryOrder.released !='1' && currentDeliveryOrder.sentToErpInfo !='提交审核成功')">打印A4标签</button>
<button class="btn btn-primary" ng-click="printDeliveryOrderSingleLabel()" ng-disabled="productGridOption.data.length == 0 || (currentDeliveryOrder.released !='1' && currentDeliveryOrder.sentToErpInfo !='提交审核成功')"
<button class="btn btn-primary" ng-click="printDeliveryOrder()" ng-disabled="currentDeliveryOrder.released !='1' && currentDeliveryOrder.sentToErpInfo !='1'">打印送货单</button>
<button class="btn btn-primary" ng-click="printDeliveryOrderLabels()" ng-disabled="productGridOption.data.length == 0 || (currentDeliveryOrder.released !='1' && currentDeliveryOrder.confirm !='1')">打印A4标签</button>
<button class="btn btn-primary" ng-click="printDeliveryOrderSingleLabel()" ng-disabled="productGridOption.data.length == 0 || (currentDeliveryOrder.released !='1' && currentDeliveryOrder.confirm !='1')"
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'"
......
ALTER TABLE srm_do_mst_file ADD CONFIRM varchar(1) DEFAULT '0' COMMENT '状态(0.未审核 1.已审核)';
\ No newline at end of file
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