Commit 6bce2cd4 authored by 刘学辉's avatar 刘学辉

在建工程转固模块

parent 601d9e32
var gridManager = null;
$(document).ready(function () {
initialize();
loadGrid();
bindEvent();
});
function initialize(){
var mainFileTable = $('#sapAssessInfoList').fileList();
mainFileTable.find('table').css({
borderTopWidth : 0
});
$('#sapAssessInfoList').fileList({
bizId : $("#attbizId").val()
});
UICtrl.layout("#layout", {leftWidth: 3});
}
function bindEvent(){
}
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
UICtrl.addGridRow(gridManager);
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid');
DataUtil.delSelectedRows({
action: 'sapFixedAssessItem/deleteSapFixedAssessItems.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
}
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{
display: "主资产号", name: "anln1", width: 140, minWidth: 60, type: "string", align: "left",
/*editor: {
required: true, type: "select",
data: {
type: 'system',
name: "querySapFixedAssets",
back: {
anln1: "anln1",
}
},
}*/
editor: {
type: "text"
}
},
{
display: "公司代码", name: "bukrs", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "BUKRS"}
},
back: {
BUKRS: "bukrs",
}
},
}
},
{
display: "成本中心", name: "kostl", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "queryCostCenter",
back: {
kostl: "kostl",
}
},
}
},
{
display: "凭证日期", name: "bldat", width: 120, minWidth: 60, type: "date", align: "left",
editor: {required: false, type: "date"}
},
{
display: "过账日期", name: "budat", width: 120, minWidth: 60, type: "date", align: "left",
editor: {required: false, type: "date"}
},
{
display: "资产起息日", name: "bzdat", width: 120, minWidth: 60, type: "date", align: "left",
editor: {required: false, type: "date"}
},
{
display: "文本", name: "sgtxt", width: 180, minWidth: 60, type: "string", align: "left",
editor: {required: false, type: "text"}
},
{
display: "报废金额", name: "anbtr", width: 100, minWidth: 60, type: "string", align: "left",
editor: {required: false, mask: 'nnnnnnnn.nn',type:"text"}
},
{
display: "百分比(%)", name: "prozs", width: 100, minWidth: 60, type: "string", align: "left",
editor: {required: false, mask: 'nn',type: "text"}
},
{
display: "购置业务年度", name: "xa", width: 160, minWidth: 60, type: "string", align: "left",
editor: {required: false, type: "text"}
},
],
dataAction: "server",
url: web_app.name + '/sapFixedAssessItem/querySapFixedAssessItems.ajax',
pageSize: 10,
usePager: true,
parms:{sapRetirementId:getId()},
toolbar: toolbarOptions,
enabledEdit: true,
width: "100%",
height: "80%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(gridManager);
}
/**
* 流程引擎回调设置打样的id
* @param value 打样申请的id
*/
function setId(id) {
$("#id").val(id);
var _grid=UICtrl.getGridManager('#maingrid');
_grid.options.parms.sapRetirementId = id;
$('#sapAssessList').fileList({
bizId : id
});
}
/**
* 流程引擎获取打样申请id的回掉方法。
* @return 打样申请的id
*/
function getId() {
return $("#id").val() || "";
}
function reloadGrid() {
gridManager.loadData();
}
function getExtendedData(processAction) {
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
var extendedData = {};
var _grid = UICtrl.getGridManager('#maingrid');
if (_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: true
});
if (!datas) {
return false;
}
extendedData.items = Public.encodeJSONURI(datas);
}
return extendedData;
}
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date,attachment"/>
<x:script src='/biz/topsun/sap/fixedAssets/sapFixedAssess/sapFixedAssessDetail.js'/>
</head>
<body>
<x:billTitle title="在建工程转固" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="billCode"/>
<x:hidden name="attbizId"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="tel" required="true" label="联系方式" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="reason" required="true" label="原因" labelCol="2" fieldCol="6"/>
</div>
</div>
<div class="blank_div clearfix"></div>
<div id="maingrid" style="margin: 2px;">
</div>
<div style="padding-top: 15px;">
<x:fileList bizCode="sapAssessInfo" bizId="attbizId" id="sapAssessInfoList" title="相关资料" />
</div>
</form>
</body>
</html>
var gridManager = null;
$(document).ready(function () {
initUI();
loadGrid();
})
function initUI() {
UICtrl.initDefaultLayout();
}
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: addHandler,
// exportExcelHandler:exportExcelHandler,
// exportModelHandler:{id:'exportModelHandler',img:'fa-cloud-download',text:'导出模板',click:exportModelHandler},
impExcelDataHandler:{id:'impExcelData',img:'fa-table',text:'导入数据',click:impExcelDataHandler},
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, 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: "deptName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "联系电话", name: "tel", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "原因", name: "reason", width: 300, minWidth: 60, type: "string", align: "left"},
{display: "资产编号", name: "anln1", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "公司代码", name: "bukrs", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "成本中心", name: "kostl", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "凭证日期", name: "bldat", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "过账日期", name: "budat", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "资产起息日", name: "bzdat", width: 120, minWidth: 60, type: "string", align: "left"},
// {display: "报废金额", name: "anbtr", width: 100, minWidth: 60, type: "string", align: "left"},
// {display: "百分比", name: "prozs", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "购置业务年度", name: "xa", width: 120, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/sapFixedAssess/slicedSapFixedAssessList.ajax',
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
doView(data.sapRetirementId);
},
});
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
//删除按钮
function deleteHandler() {
DataUtil.del({
action: 'sapFixedAssess/deleteSapFixedAssess.ajax',
gridManager: gridManager, idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
}
function addHandler() {
UICtrl.addTabItem({
tabid: 'addSapFixedRetirement',
text: "在建工程转固",
url: web_app.name + '/sapFixedAssess/forwardSapFixedAssessDetail.job'
});
}
function doView(id) {
UICtrl.addTabItem({
tabid: 'viewSapFixedRetirement'+id,
text: "在建工程转固",
url: web_app.name + '/sapFixedAssess/showFixedAssess.job?bizId='+id+"&isReadOnly=true"
});
}
//导出模板
function exportModelHandler() {
// if(getTemplateId() == ''){
// Public.tip('请选择数据模板。');
// return;
// }
var templetName='固定资产报废';
var templateId="ea17de07deae11eeb82b00ffd30dba71";
var url=web_app.name+'/excelImport/exportExcelTemplate.ajax';
UICtrl.downFileByAjax(url,{id:" ",templateCode:"sapFixedAssessData"},templetName);
}
//从EXCEL导入数据
function impExcelDataHandler(){
ExcelImpManager.showImpDialog('导入', 'sapFixedAssessData', Public.getUUID(), saveUpLoadGrid);
}
function saveUpLoadGrid() {
var batchNumber=$('#batchNumber').val();
Public.ajax(web_app.name + '/sapFixedAssess/importExcelData.ajax'
, {batchNumber: batchNumber}, function (data) {
reloadGrid();
});
}
\ No newline at end of file
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,attachment"/>
<x:script src="/system/excelimport/AssignCodeImp.js"/>
<x:script src='/biz/topsun/sap/fixedAssets/sapFixedAssess/sapFixedAssessList.js'/>
</head>
<body>
<div class="container-fluid">
<div class="ui-hide">
</div>
<div id="layout">
<div position="center" title="在建工程转固">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:hidden name="templetId" value="sapFixedRetirementData"/>
<x:hidden name="batchNumber" value=""/>
<x:hidden name="fullId"/>
<x:inputC name="billCode" required="false" label="申请单号" labelCol="1"/>
<x:inputC name="reason" required="false" label="原因" labelCol="1"/>
<x:selectC name="status" label="审批状态" labelCol="1" fieldCol="2" dictionary="bizBillStatus"/>
<x:searchButtons/>
</form>
<div class="blank_div clearfix"></div>
<div id="maingrid" style="margin: 2px;"></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.huigou.topsun.sap.fixedAssets.application;
import com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssess;
import com.huigou.topsun.sap.fixedAssets.domain.SapRetirement;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssessQueryRequest;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedRetirementQueryRequest;
import java.util.List;
import java.util.Map;
/**
* @Auther:LXH
* @Date: 2024/03/11/11:35
* @Description:
*/
public interface SapFixedAssessApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/sap/fixedAssets/fixedAssess.xml";
String PROCESS_DEFINITION_KEY = "sapFixedAssessProc";
Map<String, Object> getFixedAssessList(SapFixedAssessQueryRequest sapAssessVo);
SapFixedAssess getFixedAssessById(String id);
void deleteByIds(List<String> ids);
String importExcelData(String batchNumber);
}
package com.huigou.topsun.sap.fixedAssets.application;
import com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssessItem;
import com.huigou.topsun.sap.fixedAssets.domain.SapRetirementItem;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssessQueryRequest;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedRetirementQueryRequest;
import java.util.List;
import java.util.Map;
/**
* @Auther: LXH
* @Date: 2024/03/11/11:35
* @Description:
*/
public interface SapFixedAssessItemApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/sap/fixedAssets/fixedAssessItem.xml";
void saveSapFixedAssessItems(String sapAssessId, List<SapFixedAssessItem> items);
Map<String,Object> querySapFixedAssessItems(SapFixedAssessQueryRequest queryRequest);
void deleteByIds(List<String> ids);
List<SapFixedAssessItem> findBySapFixedAssessId(String sapFixedAssessId);
}
package com.huigou.topsun.sap.fixedAssets.application.impl;
import com.huigou.cache.DictUtil;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.base.coderule.application.CodeRuleApplication;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedAssessApplication;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedAssessItemApplication;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedRetirementApplication;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedRetirementItemApplication;
import com.huigou.topsun.sap.fixedAssets.domain.*;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssessQueryRequest;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedRetirementQueryRequest;
import com.huigou.topsun.sap.fixedAssets.repository.*;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.doc.attachment.application.AttachmentApplication;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ApplicationContextWrapper;
import com.huigou.util.ClassHelper;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Auther: Lxh
* @Date: 2024/03/11/16:35
* @Description:
*/
@Service("sapFixedAssessApplication")
public class SapFixedAssessApplicationImpl extends FlowBroker implements SapFixedAssessApplication {
@Autowired
private SapFixedAssessRepository sapFixedAssessRepository;
@Autowired
private SapFixedAssessItemApplication sapFixedAssessItemApplication;
// @Autowired
// private TmpFixedAssessDataRepository tmpFixedAssessDataRepository;
@Autowired
private SapFixedAssessItemRepository sapFixedAssessItemRepository;
@Autowired
private AttachmentApplication attachmentApplication;
@Autowired
private CodeRuleApplication codeRuleApplication;
@Override
public Map<String, Object> getFixedAssessList(SapFixedAssessQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "sapFixedAssess");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
if (queryRequest.getStatus() != null) {
queryModel.addCriteria(" and t.status =:status");
queryModel.putParam("status", queryRequest.getStatus());
}
if (queryRequest.getBillCode() != null) {
queryModel.addCriteria(" and t.bill_code =:billCode");
queryModel.putParam("billCode", queryRequest.getBillCode());
}
if (queryRequest.getReason() != null) {
queryModel.addCriteria(" and t.reason like:reason");
queryModel.putLikeParam("reason", queryRequest.getReason());
}
queryModel.putDictionary("status", DictUtil.getDictionary("bizBillStatus"));
queryModel.addCriteria(" order by bill_code desc ");
Map<String, Object> map = this.sqlExecutorDao.executeSlicedQuery(queryModel);
return map;
}
@Override
public SapFixedAssess getFixedAssessById(String id) {
return sapFixedAssessRepository.findOne(id);
}
@Override
public void deleteByIds(List<String> ids) {
ids.forEach(id->{
sapFixedAssessRepository.delete(id);
});
}
@Override
protected void onEnd(DelegateExecution delegateExecution) {
super.onEnd(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
BizBillStatus status = approvePassed() ? BizBillStatus.COMPLETED : BizBillStatus.ABORTED;
SapFixedAssess fixedAssess = sapFixedAssessRepository.findOne(bizId);
fixedAssess.setStatusId(status.getId());
sapFixedAssessRepository.save(fixedAssess);
}
@Override
protected void onAbortProcessInstance(DelegateExecution delegateExecution) {
super.onAbortProcessInstance(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
SapFixedAssess fixedAssess = sapFixedAssessRepository.findOne(bizId);
fixedAssess.setStatusId(BizBillStatus.ABORTED.getId());
sapFixedAssessRepository.save(fixedAssess);
}
@Override
protected void onBack(DelegateTask delegateTask, String destActivityId) {
super.onBack(delegateTask, destActivityId);
if ("Apply".equalsIgnoreCase(destActivityId)) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
SapFixedAssess fixedAssess = sapFixedAssessRepository.findOne(bizId);
fixedAssess.setStatusId(BizBillStatus.APPLYING.getId());
sapFixedAssessRepository.save(fixedAssess);
}
}
@Override
protected Map<String, Object> getProcessBizParams(String bizId) {
return ClassHelper.toMap(sapFixedAssessRepository.getOne(bizId));
}
@Override
protected String saveBizAndApprovalData() {
super.saveBizAndApprovalData();
SapFixedAssess fixedAssess = getBizEntity(SapFixedAssess.class);
if (fixedAssess.isNew()) {
fixedAssess.setStatusId(BizBillStatus.APPLYING.getId());
} else {
fixedAssess = (SapFixedAssess) commonDomainService.loadAndFillinProperties(fixedAssess);
}
fixedAssess = sapFixedAssessRepository.save(fixedAssess);
List<SapFixedAssessItem> items = getBizEntities(SapFixedAssessItem.class, "items");
sapFixedAssessItemApplication.saveSapFixedAssessItems(fixedAssess.getId(),items);
//更新附件ID为主键ID
// if (!(fixedAssess.getId().equals(fixedAssess.getAttbizId()))) {
// List<Attachment> attachmentList = attachmentApplication.queryAttachments("sapAssessInfo", fixedAssess.getAttbizId());
// for (Attachment attachment : attachmentList) {
// attachment.setBizId(fixedAssess.getId());
// attachmentApplication.saveAttachment(attachment);
// }
// }
return fixedAssess.getId();
}
@Override
public String importExcelData(String batchNumber) {
/* List<TmpFixedAssessData> dataList=tmpFixedAssessDataRepository.findByBatchNumber(batchNumber);
try {
if (dataList.size()>0){
SapAssess fixedAssess = new SapAssess();
fixedAssess.setReason("导入");
fixedAssess.setStatusId(3);
fixedAssess.setFillinDate(new Date());
Operator operator = getOperator();
fixedAssess.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
// String billCode= codeRuleApplication.getNextCode("","sapAssess","");
Object codeGenerator = ApplicationContextWrapper.getBean("codeGenerator");
Method method = codeGenerator.getClass().getMethod("getNextCode", new Class[]{String.class});
String code = (String) method.invoke(codeGenerator, new Object[]{"sapAssess"});
fixedAssess.setBillCode(code);
sapFixedAssessRepository.save(fixedAssess);
for (TmpFixedAssessData data : dataList) {
SapAssessItem sapAssessItem = new SapAssessItem();
ClassHelper.copyProperties(data, sapAssessItem);
sapAssessItem.setSapAssessId(fixedAssess.getId());
sapFixedAssessItemRepository.save(sapAssessItem);
}
}
}catch(Exception ex){
ex.printStackTrace();
}*/
return "";
}
}
package com.huigou.topsun.sap.fixedAssets.application.impl;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedAssessItemApplication;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedRetirementItemApplication;
import com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssessItem;
import com.huigou.topsun.sap.fixedAssets.domain.SapRetirementItem;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssessQueryRequest;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedRetirementQueryRequest;
import com.huigou.topsun.sap.fixedAssets.repository.SapFixedAssessItemRepository;
import com.huigou.topsun.sap.fixedAssets.repository.SapFixedRetirementItemRepository;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Auther: LXH
* @Date: 2024/03/11/15:16
* @Description:
*/
@Service("sapFixedAssessItemApplication")
public class SapFixedAssessItemApplicationImpl extends BaseApplication implements SapFixedAssessItemApplication {
@Autowired
private SapFixedAssessItemRepository sapFixedAssessItemRepository;
@Override
public void saveSapFixedAssessItems(String sapFixedAssessId, List<SapFixedAssessItem> items) {
for (SapFixedAssessItem item : items) {
item.setSapFixedAssessId(sapFixedAssessId);
sapFixedAssessItemRepository.save(item);
}
}
@Override
public Map<String, Object> querySapFixedAssessItems(SapFixedAssessQueryRequest queryRequest) {
Map<String, Object> map = new HashMap<>();
if (StringUtil.isNotBlank(queryRequest.getSapFixedAssessId())){
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "sapFixedAssessItems");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
if (queryRequest.getSapFixedAssessId() != null) {
queryModel.addCriteria(" and t.sap_fixed_assess_id =:sapFixedAssessId");
queryModel.putParam("sapFixedAssessId", queryRequest.getSapFixedAssessId());
}
map = this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
return map;
}
@Override
public void deleteByIds(List<String> ids) {
ids.forEach(id->{
sapFixedAssessItemRepository.delete(id);
});
}
@Override
public List<SapFixedAssessItem> findBySapFixedAssessId(String sapRetirementId) {
return sapFixedAssessItemRepository.findBySapFixedAssessId(sapRetirementId);
}
}
package com.huigou.topsun.sap.fixedAssets.controller;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedAssessApplication;
import com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssess;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssessQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.client.CommonController;
import com.huigou.uasp.tool.dataimport.application.ExcelImportApplication;
import com.huigou.util.CommonUtil;
import com.huigou.util.SDO;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @Auther: LXH
* @Date: 2024/03/13/10:34
* @Description:
*/
@Controller
@ControllerMapping("/sapFixedAssess")
public class SapFixedAssessController extends CommonController {
@Override
protected String getPagePath() {
return "/biz/topsun/sap/fixedAssets/sapFixedAssess/";
}
@Resource
private SapFixedAssessApplication sapFixedAssessApplication;
private ExcelImportApplication excelImportApplication;
public String forwardSapFixedAssessList(){
return forward("sapFixedAssessList");
}
public String slicedSapFixedAssessList(){
SDO sdo = this.getSDO();
SapFixedAssessQueryRequest queryRequest = sdo.toQueryRequest(SapFixedAssessQueryRequest.class);
Map<String, Object> map = sapFixedAssessApplication.getFixedAssessList(queryRequest);
return toResult(map);
}
public String forwardSapFixedAssessDetail(){
this.putAttribute("processDefinitionKey", SapFixedAssessApplication.PROCESS_DEFINITION_KEY);
// 新增的时候procUnitId一定要设置成Apply,不然jsp页面的所有表单元素是readonly状态
this.putAttribute("procUnitId", "Apply");
SapFixedAssess sapAssess = new SapFixedAssess();
sapAssess.setStatusId(BizBillStatus.APPLYING.getId());
/**
* 设置jsp页面初始化填充数据,如果不设置, 那么在jsp页面上填写完表单之后立即提交申请TaskDescription获取不到时间和相关人员信息
*/
sapAssess.setAttbizId(CommonUtil.createGUID()); // 自动生成附件id
Operator operator = getOperator();
sapAssess.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
// ExcelImportTemplate excelImportTemplate=excelImportApplication.loadExcelImportTemplateByCode("sapFixedAssessData");
return forward("sapFixedAssessDetail",sapAssess);
}
public String showFixedAssess(){
SDO sdo = this.getSDO();
String id = sdo.getBizId();
// this.putAttribute("attbizId", id); // 设置附件id
SapFixedAssess sapAssess = sapFixedAssessApplication.getFixedAssessById(id);
// sapAssess.setAttbizId(id);
return forward("sapFixedAssessDetail",sapAssess);
}
/**
* 删除在建工程转固
*/
public String deleteSapFixedAssess() {
List<String> ids = this.getSDO().getIds();
sapFixedAssessApplication.deleteByIds(ids);
return success();
}
/*
*导入数据
*/
public String importExcelData() {
SDO sdo = this.getSDO();
String batchNumber = sdo.getString("batchNumber");
sapFixedAssessApplication.importExcelData(batchNumber);
return success();
}
}
package com.huigou.topsun.sap.fixedAssets.controller;
import com.huigou.topsun.sap.fixedAssets.application.SapFixedAssessItemApplication;
import com.huigou.topsun.sap.fixedAssets.domain.query.SapFixedAssessQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.util.List;
import java.util.Map;
/**
* @Auther: LXH
* @Date: 2024/03/13/10:12
* @Description:
*/
@Controller
@ControllerMapping("/sapFixedAssessItem")
public class SapFixedAssessItemController extends CommonController {
@Autowired
private SapFixedAssessItemApplication sapFixedAssessItemApplication;
public String querySapFixedAssessItems(){
SDO sdo = this.getSDO();
SapFixedAssessQueryRequest queryRequest = sdo.toQueryRequest(SapFixedAssessQueryRequest.class);
Map<String, Object> map = sapFixedAssessItemApplication.querySapFixedAssessItems(queryRequest);
return toResult(map);
}
public String deleteSapFixedAssessItems(){
SDO sdo = this.getSDO();
List<String> ids = sdo.getIds();
sapFixedAssessItemApplication.deleteByIds(ids);
return success();
}
}
package com.huigou.topsun.sap.fixedAssets.domain;
import com.huigou.data.domain.model.FlowBillAbstractEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Auther: lxh
* @Date: 2024/03/11/10:10
* @Description:在建工程核算
*/
@Table(name = "sap_fixed_assess")
@Entity
@Data
public class SapFixedAssess extends FlowBillAbstractEntity {
/**
* 联系方式
*/
@Column(name = "tel")
private String tel;
/**
* 原因
*/
@Column(name = "reason")
private String reason;
//@Transient
@Column(name = "attbiz_id")
private String attbizId;
@Override
protected String getCodeRuleId() {
return "sapFixedAssess";
}
}
package com.huigou.topsun.sap.fixedAssets.domain;
import com.huigou.data.domain.model.AbstractEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
* SAP在建工程核算及转固
*
* @TableName sap_fixed_assess_item
*/
@Table(name = "sap_fixed_assess_item")
@Entity
@Data
public class SapFixedAssessItem extends AbstractEntity {
/**
* SAPv
*/
@Column(name = "sap_fixed_assess_id")
private String sapFixedAssessId;
/**
* 公司代码(必填)
*/
@Column(name = "bukrs")
private String bukrs;
/**
* 主资产号
*/
@Column(name = "anln1")
private String anln1;
/**
* 子资产号
*/
@Column(name = "anln2")
private String anln2;
/**
* 凭证日期
*/
@Column(name = "bldat")
private Date bldat;
/**
* 过账日期
*/
@Column(name = "BUDAT")
private Date budat;
/**
* 资产起息日
*/
@Column(name = "BZDAT")
private Date bzdat;
/**
* 文本
*/
@Column(name = "SGTXT")
private String sgtxt;
/**
* 接收方
*/
@Column(name = "empge")
private String empge;
/**
* 百分比
*/
@Column(name = "PROZS")
private BigDecimal prozs;
/**
* 金额
*/
@Column(name = "betrr")
private BigDecimal betrr;
}
\ No newline at end of file
package com.huigou.topsun.sap.fixedAssets.domain.query;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
/**
* @Auther: lxh
* @Date: 2024/03/11/10:38
* @Description:
*/
@Data
public class SapFixedAssessQueryRequest extends QueryAbstractRequest {
private String sapFixedAssessId;
private String billCode;
private String reason;
private String status;
}
package com.huigou.topsun.sap.fixedAssets.repository;
import com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssessItem;
import com.huigou.topsun.sap.fixedAssets.domain.SapRetirementItem;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @Auther: lxh
* @Date: 2024/03/11/10:33
* @Description:
*/
public interface SapFixedAssessItemRepository extends JpaRepository<SapFixedAssessItem,String> {
List<SapFixedAssessItem> findBySapFixedAssessId(String sapFixedAssessId);
}
package com.huigou.topsun.sap.fixedAssets.repository;
import com.huigou.topsun.sap.fixedAssets.domain.SapFixedAssess;
import com.huigou.topsun.sap.fixedAssets.domain.SapRetirement;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @Auther: LXH
* @Date: 2024/03/11/10:33
* @Description:
*/
public interface SapFixedAssessRepository extends JpaRepository<SapFixedAssess,String> {
}
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="sapFixedAssessProc" name="在建工程转固" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="#{sapFixedAssessApplication}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="#{sapFixedAssessApplication}"></activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="Apply" name="在建工程转固申请" activiti:formKey="sapFixedAssess/showFixedAssess.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{sapFixedAssessApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{sapFixedAssessApplication}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="Approve" name="在建工程转固审批" activiti:assignee="${assignee} " activiti:formKey="sapFixedAssess/showFixedAssess.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{sapFixedAssessApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{sapFixedAssessApplication}"></activiti:taskListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="handlerList" activiti:elementVariable="assignee">
<completionCondition>${chiefApprovePassed}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="Apply"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="Apply" targetRef="Approve"></sequenceFlow>
<exclusiveGateway id="ApproveFinished" name="审批结束"></exclusiveGateway>
<sequenceFlow id="flow3" name="审批通过" sourceRef="ApprovePassed" targetRef="ApproveFinished">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvePassed}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4" name="审批结束" sourceRef="ApproveFinished" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approveFinished}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow5" name="审批未结束" sourceRef="ApproveFinished" targetRef="Approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approveFinished}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="ApprovePassed" name="审批通过"></exclusiveGateway>
<sequenceFlow id="flow6" sourceRef="Approve" targetRef="ApprovePassed"></sequenceFlow>
<sequenceFlow id="flow9" name="审批未通过" sourceRef="ApprovePassed" targetRef="Apply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approvePassed}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_sapFixedAssessProc">
<bpmndi:BPMNPlane bpmnElement="sapFixedAssessProc" id="BPMNPlane_sapFixedAssessProc">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="50.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="550.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Apply" id="BPMNShape_Apply">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Approve" id="BPMNShape_Approve">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApproveFinished" id="BPMNShape_ApproveFinished">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="440.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApprovePassed" id="BPMNShape_ApprovePassed">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="349.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="372.0" y="85.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="372.0" y="195.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="240.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="372.0" y="389.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="440.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="320.0" y="396.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="372.0" y="480.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="550.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="382.0" y="489.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="392.0" y="460.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="459.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="317.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="489.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="453.0" y="267.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="459.0" y="411.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="372.0" y="295.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="349.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="352.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="167.0"></omgdi:waypoint>
<omgdi:waypoint x="292.0" y="167.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="257.0" y="376.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="sapFixedAssess" label="在建工程转固" table="sap_fixed_assess">
<sql-query>
select
t.fillin_date,
t.bill_code,
t.status,
t.full_id,
t.organ_id,
t.organ_name,
t.dept_id,
t.dept_name,
t.position_id,
t.position_name,
t.person_member_id,
t.person_member_name,
t.version,
t.tel,t.reason,
ti.id,
ti.sap_fixed_assess_id,
ti.anln1,ti.bukrs,ti.kostl,
ti.bldat,ti.budat,ti.bzdat,ti.sgtxt,ti.anbtr,ti.prozs,ti.xa
from sap_fixed_assess t left join sap_fixed_assess_item ti on t.id = ti.sap_fixed_assess_id where 1=1
</sql-query>
<condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/>
</query>
</query-mappings>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="sapFixedAssessItems" label="在建工程转固明细" table="sap_fixed_assess_item">
<sql-query>
select t.* from sap_fixed_assess_item t
</sql-query>
<condition column="sap_fixed_assess_id" name="sapFixedAssessId" type="java.lang.String" symbol="=" alias="t"/>
</query>
</query-mappings>
\ 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