Commit 339a0997 authored by wanghang's avatar wanghang

费用报销 流程改

parent d3c18fc6
......@@ -350,18 +350,21 @@ var tableArray = [
//创建表格(参数、列、插入的节点、数据源)
function loadGrid(obj) {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
tableArray.forEach((item) => {
UICtrl.addGridRow(item.gridManager, {zepItemno: getZepItemNo()});
});
},
deleteHandler: function () {
tableArray.forEach((item) => {
item.gridManager.deleteSelectedRow();
});
}
});
var toolbarOptions =null;
// if(obj.node=="reimbursementApplierGrid") {
toolbarOptions= UICtrl.getDefaultToolbarOptions({
addHandler: function () {
tableArray.forEach((item) => {
UICtrl.addGridRow(item.gridManager, {zepItemno: getZepItemNo()});
});
},
deleteHandler: function () {
tableArray.forEach((item) => {
item.gridManager.deleteSelectedRow();
});
}
});
// }
obj.gridManager = UICtrl.grid("#" + obj.node, {
columns: obj.columns,
dataAction: "local",
......@@ -371,8 +374,8 @@ function loadGrid(obj) {
toolbar: toolbarOptions,
usePager: false,
enabledEdit: true,
width: "100%",
height: 300,
// width: "100%",
// height: 300,
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
......@@ -497,7 +500,7 @@ function getZepItemNo(){
if(result.length>0){
//获取上一个节点的子序值
let wornNo= parseInt(result[result.length-1]["zepItemno"], 10);
zepItemNo=("00" + (wornNo + 1)).slice(-4);
zepItemNo=("00" + (wornNo + 1)).slice(-3);
}
return zepItemNo;
}
\ No newline at end of file
......@@ -25,21 +25,20 @@
<x:hidden name="personMemberName"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="kokrs" required="false" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="usnam" required="false" label="付款申请创建日期" labelCol="2" fieldCol="2"/>
<x:inputC name="zepNo" required="false" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="zepFcrdate" required="false" wrapper="date" label="付款申请创建日期" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFtype" required="false" label="EP付款申请类别" labelCol="2" maxLength="64"
fieldCol="2"
wrapper="date"/>
/>
<x:inputC name="zepFtypename" required="false" label="EP付款申请类别名称" labelCol="2" maxLength="64"
fieldCol="2"
wrapper="date"/>
fieldCol="2"/>
<x:inputC name="bukrs" required="false" label="公司代码" labelCol="2" fieldCol="2"/>
<x:inputC name="butxt" required="false" label="公司代码名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepart" required="false" label="EP部门代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepDepartname" required="false" label="EP部门名称" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppli" required="false" label="EP流程申请人代码" labelCol="2" fieldCol="2"/>
<x:inputC name="zepAppliname" required="false" label="EP流程申请人" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFcrdate" required="false" label="付款申请创建日期" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFcrdate" wrapper="date" required="false" label="付款申请创建日期" labelCol="2" fieldCol="2"/>
<x:inputC name="zepNo" required="false" label="EP流程单号" labelCol="2" fieldCol="2"/>
<x:inputC name="zepTxt" required="false" label="付款申请内容" labelCol="2" fieldCol="2"/>
<x:inputC name="zepFtamount" required="false" label="申请总金额(本位币)" labelCol="2" fieldCol="2"/>
......@@ -54,14 +53,17 @@
</div>
<div class="blank_div clearfix"></div>
<x:title title="报销人填写" name="group"/>
<div id="reimbursementApplierGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="财务审核填写" name="group"/>
<div id="financialAuditGrid" style="margin: 2px;">
</div>
<div class="blank_div clearfix"></div>
<x:title title="资金岗填写" name="group"/>
<div id="capitalPostGrid" style="margin: 2px;">
</div>
</div>
......
......@@ -23,5 +23,5 @@ public interface SapCostReimbursementApplication {
void deleteSapCostReimbursementById(String id);
void deleteSapCostReimbursementByIds(List<String> ids);
// void sendSapDate(String bizId);
void sendSapDate(String bizId);
}
\ No newline at end of file
......@@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -99,8 +100,7 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
sapCostReimbursement.setStatusId(status.getId());
costReimbursementRepository.save(sapCostReimbursement);
//审核完成、远程调用sap接口
// sendSapDate(bizId);
sendSapDate(bizId);
}
@Override
......@@ -155,26 +155,34 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
}
// /**
// * 远程调用sap接口,传递数据
// *
// * @param bizId
// */
// public void sendSapDate(String bizId) {
// SapStatsIndicators sapStatsIndicators = sapStatsIndicatorsRepository.findOne(bizId);
// if (sapStatsIndicators.getStatusId() == BizBillStatus.APPLYING.getId()) {
// throw new RuntimeException("本数据未经审批完成!");
// }
// List<SapStatsIndicatorsDetail> all = sapStatsIndicatorsDetailRepository.findAllByStatsIndicatorsId(bizId);
// List<Map<String, Object>> list = new ArrayList<>();
// ObjectMapper objectMapper = new ObjectMapper();
// Map<String, Object> map = MyBaseUtil.convertToMap(sapStatsIndicators);
// //封装参数
/**
* 远程调用sap接口,传递数据
*
* @param bizId
*/
public void sendSapDate(String bizId) {
SapCostReimbursement sapCostReimbursement = costReimbursementRepository.findOne(bizId);
if (sapCostReimbursement.getStatusId() == BizBillStatus.APPLYING.getId()) {
throw new RuntimeException("本数据未经审批完成!");
}
List<SapCostReimbursementDetail> all = costReimbursementDetailRepository.findAllByReimbursementBaseInfoId(bizId);
List<Map<String, Object>> list = new ArrayList<>();
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> map = MyBaseUtil.convertToMap(sapCostReimbursement,true);
//封装参数
// for (SapStatsIndicatorsDetail sapStatsIndicatorsDetail : all) {
// Map<String, Object> detailMap = objectMapper.convertValue(sapStatsIndicatorsDetail, Map.class);
// map.put("ITEM", detailMap);
// list.add(map);
// }
// String url = "cud_kb31n/kb31n";
// SapStatsIndicatorsResult sapStatsIndicatorsResult = null;
// try {
......@@ -199,6 +207,6 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
// sapStatsIndicatorsResult.setStatsIndicatorsId(bizId);
// sapStatsIndicatorsResultRepository.save(sapStatsIndicatorsResult);
// }
// }
}
}
\ No newline at end of file
......@@ -47,10 +47,12 @@ public class SapCostReimbursementController extends CommonController {
//定义流程
this.putAttribute("processDefinitionKey", SapCostReimbursementApplication.PROCESS_DEFINITION_KEY);
this.putAttribute("procUnitId", "Apply");//定义流程环节的id
SapCostReimbursement sapCostReimbursement = new SapCostReimbursement();
sapCostReimbursement.setStatusId(BizBillStatus.APPLYING.getId());
Operator operator = getOperator();//获取当前操作员的详情信息
sapCostReimbursement.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
sapCostReimbursement.setZepNo(sapCostReimbursement.getBillCode());
return forward("costReimbursement",sapCostReimbursement);
}
......
......@@ -186,7 +186,7 @@ public class SapStatsIndicatorsApplicationImpl extends FlowBroker implements Sap
List<SapStatsIndicatorsDetail> all = sapStatsIndicatorsDetailRepository.findAllByStatsIndicatorsId(bizId);
List<Map<String, Object>> list = new ArrayList<>();
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> map = MyBaseUtil.convertToMap(sapStatsIndicators);
Map<String, Object> map = MyBaseUtil.convertToMap(sapStatsIndicators,false);
//封装参数
for (SapStatsIndicatorsDetail sapStatsIndicatorsDetail : all) {
Map<String, Object> detailMap = objectMapper.convertValue(sapStatsIndicatorsDetail, Map.class);
......
......@@ -6,6 +6,7 @@ import com.huigou.topsun.proofing.domain.workInstruction.model.WorkInstructionMa
import org.springframework.beans.BeanUtils;
import org.springframework.beans.FatalBeanException;
import javax.persistence.Column;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
......@@ -127,10 +128,11 @@ public class MyBaseUtil {
/**
* 将一个对象转换为Map同时忽略它的基类
*
* @param object 要转换的对象
* @param object 要转换的对象
* @param useAnnoKey 是否使用注解的值作为Map的key
* @return 包含对象所有字段名和值的Map
*/
public static Map<String, Object> convertToMap(Object object) {
public static Map<String, Object> convertToMap(Object object, boolean useAnnoKey) {
Map<String, Object> map = new HashMap<>();
Class<?> clazz = object.getClass();
Arrays.stream(clazz.getDeclaredFields())
......@@ -139,6 +141,10 @@ public class MyBaseUtil {
try {
String fieldName = field.getName();
Object fieldValue = field.get(object);
if (useAnnoKey && field.isAnnotationPresent(Column.class)) {
Column column = field.getAnnotation(Column.class);
fieldName = column.name();
}
map.put(fieldName, fieldValue);
} catch (IllegalAccessException e) {
e.printStackTrace();
......@@ -177,9 +183,10 @@ public class MyBaseUtil {
MyBaseUtil.processNonNullProperties(workInstructionBaseInfo,map);
Map<String, Object> map1 = MyBaseUtil.convertToMap(workInstructionBaseInfo);
Map<String, Object> map1 = MyBaseUtil.convertToMap(workInstructionBaseInfo,true);
System.out.println(map);
System.out.println(map1);
}
}
......
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