Commit 339a0997 authored by wanghang's avatar wanghang

费用报销 流程改

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