Commit d22c9e23 authored by 刘学辉's avatar 刘学辉

供应商主数据维护细节完善

parent 6d8fb5c9
...@@ -33,7 +33,7 @@ function loadSuppliersDataListGrid() { ...@@ -33,7 +33,7 @@ function loadSuppliersDataListGrid() {
}); });
gridManager = UICtrl.grid("#suppliersDataListGrid", { gridManager = UICtrl.grid("#suppliersDataListGrid", {
columns: [ columns: [
{display: "申请单编号", name: "billCode", width: 60, minWidth: 60, type: "string", align: "left"}, {display: "申请单编号", name: "billCode", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请状态", name: "statusTextView", width: 60, minWidth: 60, type: "string", align: "left"}, {display: "申请状态", name: "statusTextView", width: 60, minWidth: 60, type: "string", align: "left"},
{display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "申请部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "left"},
...@@ -97,13 +97,27 @@ function resetForm(obj) { ...@@ -97,13 +97,27 @@ function resetForm(obj) {
//删除按钮 //删除按钮
function deleteHandler() { function deleteHandler() {
DataUtil.del({ // var rows = UICtrl.checkSelectedRows(gridManager);
action: 'sapSuppliersData/deleteSuppliersData.ajax', var rows = gridManager.getSelectedRows();
gridManager: gridManager, idFieldName: 'id', var statusFlag="1";
onSuccess: function () { for (var i=0;i<rows.length;i++){
reloadGrid(); if (rows[i].status!="0"){
statusFlag="0";
break;
} }
}); }
if (statusFlag=="0"){
UICtrl.alert("申请状态下的数据,才能删除!");
return false;
} else {
DataUtil.del({
action: 'sapSuppliersData/deleteSuppliersData.ajax',
gridManager: gridManager, idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
}
} }
function addHandler() { function addHandler() {
......
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
<div position="center" title="供应商主数据查询"> <div position="center" title="供应商主数据查询">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/> <x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm"> <form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:inputC name="proofingApplyNo" required="false" label="申请单号" labelCol="1"/> <x:inputC name="billCode" required="false" label="申请单号" labelCol="1"/>
<x:inputC name="partner" required="false" label="业务伙伴编号" labelCol="1"/>
<x:inputC name="nameOrg1" required="false" label="组织名称1" labelCol="1"/>
<x:searchButtons/> <x:searchButtons/>
</form> </form>
<div class="blank_div clearfix"></div> <div class="blank_div clearfix"></div>
......
...@@ -31,4 +31,5 @@ public interface SuppliersDataApplication { ...@@ -31,4 +31,5 @@ public interface SuppliersDataApplication {
Map<String, Object> loadSuppliersBankDatas(SuppliersBankQueryRequest queryRequest); Map<String, Object> loadSuppliersBankDatas(SuppliersBankQueryRequest queryRequest);
void deleteSuppliersDataByIds( List<String> ids);
} }
...@@ -21,12 +21,15 @@ import com.huigou.topsun.sap.suppliers.repository.SuppliersBuyerRepository; ...@@ -21,12 +21,15 @@ import com.huigou.topsun.sap.suppliers.repository.SuppliersBuyerRepository;
import com.huigou.topsun.sap.suppliers.repository.SuppliersInfoRepository; import com.huigou.topsun.sap.suppliers.repository.SuppliersInfoRepository;
import com.huigou.topsun.sap.suppliers.repository.SuppliersPayRepository; import com.huigou.topsun.sap.suppliers.repository.SuppliersPayRepository;
import com.huigou.uasp.bmp.common.BizBillStatus; import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.ApprovalParameter;
import com.huigou.uasp.bpm.FlowBroker; import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.uasp.bpm.HandleResult;
import com.huigou.util.ClassHelper; import com.huigou.util.ClassHelper;
import com.huigou.util.StringUtil; import com.huigou.util.StringUtil;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask; import org.activiti.engine.delegate.DelegateTask;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -53,11 +56,23 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -53,11 +56,23 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
public Map<String, Object> slicedSuppliersDataQuery(SuppliersDataQueryRequest query){ public Map<String, Object> slicedSuppliersDataQuery(SuppliersDataQueryRequest query){
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedSuppliersInfoQuery"); QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedSuppliersInfoQuery");
QueryModel model = this.sqlExecutorDao.getQueryModel(queryDescriptor, query); QueryModel model = this.sqlExecutorDao.getQueryModel(queryDescriptor, query);
if (StringUtil.isNotBlank(query.getBillCode())){
model.addCriteria(" and t.bill_code like:billCode");
model.putLikeParam("billCode", query.getBillCode());
}
if (StringUtil.isNotBlank(query.getBillCode())){
model.addCriteria(" and t.name_Org1 like:nameOrg1");
model.putLikeParam("nameOrg1", query.getNameOrg1());
}
if (StringUtil.isNotBlank(query.getPartner())){
model.addCriteria(" and t.partner like:partner");
model.putLikeParam("partner", query.getPartner());
}
// model.putDictionary("maintenanceType", DictUtil.getDictionary("maintainType")); // model.putDictionary("maintenanceType", DictUtil.getDictionary("maintainType"));
// model.putDictionary("baseUnit", DictUtil.getDictionary("measuringUnit")); // model.putDictionary("baseUnit", DictUtil.getDictionary("measuringUnit"));
// model.putDictionary("itemAttributes", DictUtil.getDictionary("suppliesType")); // model.putDictionary("itemAttributes", DictUtil.getDictionary("suppliesType"));
// model.putDictionary("businessUsage", DictUtil.getDictionary("serviceusage")); // model.putDictionary("businessUsage", DictUtil.getDictionary("serviceusage"));
// model.putDictionary("status", DictUtil.getDictionary("bizBillStatus")); model.putDictionary("status", DictUtil.getDictionary("bizBillStatus"));
return this.sqlExecutorDao.executeSlicedQuery(model); return this.sqlExecutorDao.executeSlicedQuery(model);
} }
...@@ -102,7 +117,38 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -102,7 +117,38 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
return ClassHelper.toMap(suppliersInfoRepository.getOne(bizId)); return ClassHelper.toMap(suppliersInfoRepository.getOne(bizId));
} }
@Override
protected void onBeforeComplete(DelegateTask delegateTask) {
super.onBeforeComplete(delegateTask);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
if (this.isApplyProcUnit(delegateTask) && this.getApprovalParameter().isAdvanceProcessAction()) {
SuppliersInfo suppliersInfo = suppliersInfoRepository.findOne(bizId);
suppliersInfo.setStatusId(BizBillStatus.APPROVING.getId());
suppliersInfoRepository.save(suppliersInfo);
}
}
//流程已办
@Override
public void onAfterComplete(DelegateTask delegateTask) {
super.onAfterComplete(delegateTask);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
// SuppliersInfo suppliersInfo = suppliersInfoRepository.findOne(bizId);
}
@Transactional("hanaTransactionManager")
@Override
public void onComplete(DelegateTask delegateTask) {
super.onComplete(delegateTask);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
SuppliersInfo suppliersInfo = suppliersInfoRepository.findOne(bizId);
//审批不通过
ApprovalParameter parameter = getApprovalParameter();
// if (ObjectUtils.equals(parameter.getHandleResult(), HandleResult.DISAGREE.id)) { //审批不通过 或者退回
// }
if (this.isApplyProcUnit(delegateTask)) { //申请后直接提交
}
}
/** /**
* 流程实例结束 * 流程实例结束
* *
...@@ -184,4 +230,24 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -184,4 +230,24 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
queryModel.putParam("sId", queryRequest.getSId()); queryModel.putParam("sId", queryRequest.getSId());
return this.sqlExecutorDao.executeSlicedQuery(queryModel); return this.sqlExecutorDao.executeSlicedQuery(queryModel);
} }
//删除数据
@Override
public void deleteSuppliersDataByIds( List<String> ids){
for (String id:ids){
List<SuppliersPay> suppliersPayList=this.suppliersPayRepository.findAllBySId(id);
for (SuppliersPay suppliersPay:suppliersPayList){
suppliersPayRepository.delete(suppliersPay);
}
List<SuppliersBuyer> suppliersBuyerList=this.suppliersBuyerRepository.findAllBySId(id);
for (SuppliersBuyer suppliersBuyer:suppliersBuyerList){
suppliersBuyerRepository.delete(suppliersBuyer);
}
List<SuppliersBank> suppliersBankList=this.suppliersBankRepository.findAllBySId(id);
for (SuppliersBank suppliersBank:suppliersBankList){
suppliersBankRepository.delete(suppliersBank);
}
this.suppliersInfoRepository.delete(id);
}
}
} }
...@@ -105,7 +105,7 @@ public class SuppliersDataController extends CommonController { ...@@ -105,7 +105,7 @@ public class SuppliersDataController extends CommonController {
public String deleteSuppliersData() { public String deleteSuppliersData() {
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
List<String> ids = sdo.getIds(); List<String> ids = sdo.getIds();
// suppliersDataApplication.deleteSuppliersData(ids); suppliersDataApplication.deleteSuppliersDataByIds(ids);
return success(); return success();
} }
} }
package com.huigou.topsun.sap.suppliers.domain.query; package com.huigou.topsun.sap.suppliers.domain.query;
import com.huigou.data.domain.query.FlowBillSuperQueryRequest; import com.huigou.data.domain.query.FlowBillSuperQueryRequest;
import lombok.Data;
@Data
public class SuppliersDataQueryRequest extends FlowBillSuperQueryRequest { public class SuppliersDataQueryRequest extends FlowBillSuperQueryRequest {
/** /**
* 业务伙伴编号 * 业务伙伴编号
*/ */
private String partner; private String partner;
/**
* 单据编号
*/
private String billCode;
/** /**
......
...@@ -14,5 +14,5 @@ import java.util.List; ...@@ -14,5 +14,5 @@ import java.util.List;
*/ */
public interface SuppliersBankRepository extends JpaRepository<SuppliersBank,String> { public interface SuppliersBankRepository extends JpaRepository<SuppliersBank,String> {
List<SuppliersBank> findAllBySId(String sId, Sort sortOrder); List<SuppliersBank> findAllBySId(String sId);
} }
...@@ -14,5 +14,5 @@ import java.util.List; ...@@ -14,5 +14,5 @@ import java.util.List;
*/ */
public interface SuppliersBuyerRepository extends JpaRepository<SuppliersBuyer,String> { public interface SuppliersBuyerRepository extends JpaRepository<SuppliersBuyer,String> {
List<SuppliersBuyer> findAllBySId(String sId, Sort sortOrder); List<SuppliersBuyer> findAllBySId(String sId);
} }
...@@ -17,5 +17,5 @@ public interface SuppliersPayRepository extends JpaRepository<SuppliersPay,Strin ...@@ -17,5 +17,5 @@ public interface SuppliersPayRepository extends JpaRepository<SuppliersPay,Strin
// SuppliersPay findBysId(String sId); // SuppliersPay findBysId(String sId);
List<SuppliersPay> findAllBySId(String sId, Sort sortOrder); List<SuppliersPay> findAllBySId(String sId);
} }
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</sequenceFlow> </sequenceFlow>
</process> </process>
<bpmndi:BPMNDiagram id="BPMNDiagram_sapSuppliersDataProc"> <bpmndi:BPMNDiagram id="BPMNDiagram_sapSuppliersDataProc">
<bpmndi:BPMNPlane bpmnElement="sapSuppliersDataProc" id="BPMNPlane_sapNonProdApplyProc"> <bpmndi:BPMNPlane bpmnElement="sapSuppliersDataProc" id="BPMNPlane_sapSuppliersDataProc">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="50.0"></omgdc:Bounds> <omgdc:Bounds height="35.0" width="35.0" x="355.0" y="50.0"></omgdc:Bounds>
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
......
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