Commit 43f8561d by 焦凯

Merge branch 'develop' of gitlab.beecode.cn:kunlun/xyst_dinas/xyst_dinas_backend into develop

parents 434b2779 65853aee
backend/.metadata
.metadata/
RemoteSystemsTempFiles/
/.recommenders/
......@@ -116,9 +116,10 @@ public class BaseBusinessWarn {
String[] noticePerson = warnSetting.getPersonnel();
String message = "message";
try {
if (isNotice)
notice(noticePerson,"message",warnSetting.getBillId());
notice(noticePerson, message, warnSetting.getBillId());
} catch (Exception e) {
e.printStackTrace();
}
......@@ -135,12 +136,19 @@ public class BaseBusinessWarn {
warnExeRecord.setMax(warnSetting.getMax());
warnExeRecord.setWarnSettingId(warnSetting.getSettingId());
warnExeRecord.setBillId(warnSetting.getBillId());
warnExeRecord.setMemo(warnSetting.getMemo());
return warnExeRecord;
}
/**
* 通知所有人员
* @param noticePerson
* @param message
* @param billId
* @throws Exception
*/
private void notice(String[] noticePerson,String message,UUID billId) throws Exception{
// 通知所有人员
Date currentTime = new Date();
String currentTimeStr = DateUtil.dateTime2String(currentTime);
JSONObject remObject = new JSONObject();
......@@ -148,7 +156,6 @@ public class BaseBusinessWarn {
remObject.put("id", remindId);
remObject.put("createTime", currentTimeStr);
remObject.put("remindContent", "合同预警通知");
remObject.put("remindTime", currentTimeStr);
remObject.put("data",billId );//param.getString("id")
......@@ -157,7 +164,6 @@ public class BaseBusinessWarn {
remObject.put("_type", CommonConstants.REMIND_ENTITY);
remObject.put("isToCustomer", false);
KObject kobject =(KObject)JSONObjectUtils.toObject(remObject.toString());
KObject creater = null;
List<KObject> list = staffDAO.listStaffByUsername("sysadmin");
......@@ -166,7 +172,6 @@ public class BaseBusinessWarn {
}else {
creater = list.get(0);
}
kobject.set("sender", creater);//
kobject.validate();
......@@ -176,7 +181,6 @@ public class BaseBusinessWarn {
part.put("participateId", person);
part.put("participateType", "person");
parts.put(part);
}
List<KObject> listRes = new ArrayList<KObject>();
for(int i=0;i<parts.length();i++) {
......@@ -195,7 +199,6 @@ public class BaseBusinessWarn {
String userId = userKObject.getString("id");
item.put(RemPartRelationConstants.PARTICIPATE_ID, userId);
}
KObject entity =(KObject) JSONObjectUtils.toObject(item.toString());
listRes.add(entity);
entity.validate();
......
......@@ -25,6 +25,7 @@ public class WarnExeRecord {
private String max;
private String min;
private String message;
private String memo;
......@@ -100,6 +101,12 @@ public class WarnExeRecord {
public void setMessage(String message) {
this.message = message;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
......
package com.xyst.dinas.biz.warn.dao;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.persistence.Tuple;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateCallback;
import org.springframework.orm.hibernate5.HibernateOperations;
import org.springframework.stereotype.Repository;
import com.beecode.amino.common.Convert;
import com.beecode.bcp.type.KObject;
import com.xyst.dinas.biz.warn.WarnExeRecord;
import com.xyst.dinas.biz.warn.WarnSetting;
......@@ -127,5 +137,30 @@ public class WarnSettingDao {
});
}
private static final String queryWarnSettingStaffSql = "SELECT DISTINCT(GROUP_CONCAT(personnel)) FROM xyst_dinas_warn_setting WHERE HEX(bill_id) =:contractId";
public List<String> queryWarnSettingStaffByContractId(String contractId) {
return template.execute(new HibernateCallback<List<String>>() {
//List<UUID> uuids = new ArrayList<>();
List<String> personnelIdList = new ArrayList<>();
@Override
public List<String> doInHibernate(Session session) throws HibernateException {
//List<Tuple> uuids1 = session.createSQLQuery(queryStaffSql).addEntity(Tuple.class).setParameter("postId", postId).list();
Query<Tuple> query = session.createNativeQuery(queryWarnSettingStaffSql, Tuple.class);
query.setParameter("contractId", contractId.replaceAll("-", ""));
List<Tuple> result = query.getResultList();
for (Tuple tuple : result) {
String personnelIds = tuple.get(0, String.class);
if (StringUtils.isNotEmpty(personnelIds)) {
personnelIdList = Arrays.asList(personnelIds.split(","));
}
//uuids.add(Convert.toUUID(tuple.get(0)));
}
List<String> collect = personnelIdList.stream().distinct().collect(Collectors.toList());
return collect;
}
});
}
}
......@@ -46,6 +46,9 @@
<attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='min' columnName='min' title='指标下限' type='string' default='' precision='' isArray='false'>
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='100'></annotation>
</attribute>
<attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='memo' columnName='memo' title='备注' type='string' default='' precision='' isArray='false'>
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='1000'></annotation>
</attribute>
<hibernate>/xyst.dinas.biz/src/main/resources/config/WarningExe.hbm.xml</hibernate>
</dataModel>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>c95a248e-fdd8-446e-81a1-8b054909da97</id>
<id>e6d7d0ff-fe61-46ad-8b78-0131a00c7562</id>
<name>com.xyst.dinas.biz.bill.Organization$sequence</name>
<title>组织机构$sequence</title>
<description>组织机构</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>d7431605-19fe-4aac-b40a-b4dc4f44b30f</id>
<id>224131f8-a0e6-4936-8ad1-b70bff26d660</id>
<name>com.xyst.dinas.biz.bill.Organization$serial</name>
<title>组织机构$serial</title>
<description>组织机构</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>b7a595e4-8bd8-4e9f-971f-63aa8933ad2f</id>
<id>6c221479-4e8e-4a82-87f2-537d1c2d0496</id>
<name>com.xyst.dinas.biz.bill.Organization</name>
<title>组织机构</title>
<description>组织机构</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>fec40432-96e8-4583-90b5-b926a7f21c76</id>
<id>f918d96c-7a93-41db-8811-519fb7b3b8c3</id>
<name>com.xyst.dinas.biz.bill.Position$sequence</name>
<title>岗位$sequence</title>
<description>岗位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>0d37758e-66c6-4a11-8f6a-7483b2aeb7ac</id>
<id>af81f3c9-26df-4694-9291-aacbae5286b2</id>
<name>com.xyst.dinas.biz.bill.Position$serial</name>
<title>岗位$serial</title>
<description>岗位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>66b50105-6ae9-43dd-891b-b920ea637c19</id>
<id>976cc9e6-3a6b-4d42-b438-f2310c043fb1</id>
<name>com.xyst.dinas.biz.bill.Position</name>
<title>岗位</title>
<description>岗位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>5cd1a27b-bf97-4eaa-9ce5-e1d449254ccf</id>
<id>64bf3633-d1cc-4ccd-b802-cdd2eb43a062</id>
<name>com.xyst.dinas.biz.bill.ShipInfo$sequence</name>
<title>船舶备案$sequence</title>
<description>船舶备案</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>718034ed-f1a4-44bd-9e7e-98e34194b2e4</id>
<id>fa4c2c0c-a227-4b3d-83a1-a1caae813000</id>
<name>com.xyst.dinas.biz.bill.ShipInfo$serial</name>
<title>船舶备案$serial</title>
<description>船舶备案</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>a03f6e52-9a7c-49b0-95bc-247c29978903</id>
<id>6dc4d21f-8994-42dd-819e-01bec7efc102</id>
<name>com.xyst.dinas.biz.bill.ShipInfo</name>
<title>船舶备案</title>
<description>船舶备案</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>881b4728-d7f6-484d-b929-50dafbdb252b</id>
<id>a983d109-2118-4404-a632-18820e6c4449</id>
<name>com.xyst.dinas.biz.bill.Station$sequence</name>
<title>场站$sequence</title>
<description>场站</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>9b277039-347c-40b1-98c0-7fbfe4258258</id>
<id>fa742cd1-574a-46bd-8598-c1bca547ac37</id>
<name>com.xyst.dinas.biz.bill.Station$serial</name>
<title>场站$serial</title>
<description>场站</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>69964751-1fa0-452b-9a3a-1e5124b36171</id>
<id>bd76396a-737d-4596-9592-d254678bcf2e</id>
<name>com.xyst.dinas.biz.bill.Station</name>
<title>场站</title>
<description>场站</description>
......
......@@ -132,6 +132,20 @@
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>1000</m:value>
</m:annotation>
</m:annotations>
<m:id>cbb5b983-299b-4259-97d9-6470651bb18b</m:id>
<m:name>memo</m:name>
<m:title>备注</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
</m:attributes>
</m:class>
</content>
......
......@@ -31,6 +31,9 @@
<property name="message" type="nstring" not-null="false">
<column name="message" length="100"></column>
</property>
<property name="memo" type="nstring" not-null="false">
<column name="memo" length="1000"></column>
</property>
<property name="billId" type="uuid-binary" not-null="false">
<column name="bill_id" length="16"></column>
......
......@@ -21,6 +21,8 @@ import com.xyst.dinas.contract.query.processor.ContractPerformWarningProcessor;
import com.xyst.dinas.contract.query.processor.ContractWarnSettingProcessor;
import com.xyst.dinas.contract.service.ContractService;
import com.xyst.dinas.contract.service.ContractWarnService;
import com.xyst.dinas.contract.task.ContractExpireCheckTask;
import com.xyst.dinas.contract.task.ContractExpireCheckTaskRegister;
import com.xyst.dinas.contract.web.ContractController;
/**
* 开启自动配置,无需手动注册Bean
......@@ -116,4 +118,13 @@ public class ContractConfiguration {
public ContractProcessEventListener createContractProcessEventListener() {
return new ContractProcessEventListener();
}
@Bean
public ContractExpireCheckTaskRegister contractExpireCheckTaskRegister() {
return new ContractExpireCheckTaskRegister();
}
@Bean
public ContractExpireCheckTask contractExpireCheckTask() {
return new ContractExpireCheckTask();
}
}
......@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.beecode.bcp.core.context.AminoContextHolder;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.team.pojo.ResponseObj;
import com.beecode.inz.common.BaseConstants;
import com.beecode.inz.workflow.service.InzWorkflowService;
import com.xyst.dinas.biz.dao.DinasOrganizationDao;
......@@ -114,16 +115,15 @@ public class ContractServiceImpl implements ContractService {
@Transactional
@Override
public void submitFlow(UUID id) {
public void submitFlowForInsert(UUID id) {
KObject kobject = contractDao.load(id);
if (needSubmitFlow(ContractConstant.BIZ_TYPE,kobject)) {
inzWorkflowService.startWorkflow("SUBMIT", ContractConstant.BIZ_TYPE, kobject.getString(ContractConstant.CONTRACT_NAME),kobject);
}else{
afterSubmitApproved(kobject);
afterApprovedForInsert(kobject);
}
}
//变更合同的工作流
@Override
@Transactional
public void submitFlowForUpdate(UUID id) {
......@@ -131,7 +131,7 @@ public class ContractServiceImpl implements ContractService {
if (needSubmitFlow(ContractConstant.BIZ_TYPE_UPDATE,kobject)) {
inzWorkflowService.startWorkflow("SUBMIT", ContractConstant.BIZ_TYPE_UPDATE, kobject.getString(ContractConstant.CONTRACT_NAME),kobject);
}else{
afterChangeApproved(kobject);
afterApprovedForUpdate(kobject);
}
}
......@@ -152,21 +152,6 @@ public class ContractServiceImpl implements ContractService {
return contractInfoDao.getProjectListByPurSandId(purchaseSandId, projectType, projectName);
}
public void bill() {
String billDefineName = ContractConstant.ENTITY_CONTRACT;
// BillDefine billDefine =
// Amino.getApplicationMetadataContext().getBean(billDefineName,
// BillDefine.class);
// Bill equipmentBill = billService.createBill(billDefine);
// BillData equipmentBillData = equipmentBill.getData();
}
// @Override
// public KObject queryContractById(UUID id) {
// KObject kobject = contractInfoDao.load(id);
// return kobject;
// }
@Override
public KObject getLastContractByInfoId(UUID infoId) {
......@@ -194,7 +179,7 @@ public class ContractServiceImpl implements ContractService {
}
@Override
public void afterSubmitApproved(KObject contract) {
public void afterApprovedForInsert(KObject contract) {
KObject contractInfo = contractInfoDao.load(contract.getUuid("contractId"));
contractInfo.set(ContractConstant.CONTRACT_STATE,ContractStateEnum.EXECUTING.name());
contractInfoDao.update(contractInfo);
......@@ -204,15 +189,13 @@ public class ContractServiceImpl implements ContractService {
contractInfoDao.update(contract);
//合同审批通过后,自动新增砂石余量预警设置
UUID contractId = contract.getUuid("id");
String billType = "合同";
String contractBaseInfo = getContractBaseInfo(contract);
List<KObject> detials = contract.get("contractDetails").toList();
//
for (KObject detail : detials) {
String dinasTypeName = detail.get("dinasType").getString("dinasTypeName");
String billType = "合同";
WarnSettingEntity warnSetting = new WarnSettingEntity();
warnSetting.setBillType(billType);
warnSetting.setBillId(contractId);
......@@ -220,12 +203,20 @@ public class ContractServiceImpl implements ContractService {
warnSetting.setOpen(true);
warnSetting.setMemo(contractBaseInfo);
warningSettingService.insertWarnSetting(warnSetting);
}
//自动新增一条合同到期预警设置
String target = "到期提醒(天)";
WarnSettingEntity expireWarnSetting = new WarnSettingEntity();
expireWarnSetting.setBillType(billType);
expireWarnSetting.setBillId(contractId);
expireWarnSetting.setTarget(target);
expireWarnSetting.setOpen(true);
expireWarnSetting.setMemo(contractBaseInfo);
warningSettingService.insertWarnSetting(expireWarnSetting);
}
@Override
public void afterChangeApproved(KObject contract) {
public void afterApprovedForUpdate(KObject contract) {
List<KObject> executingContracts = contractDao.getExecutingContractByContractInfoId(contract.getUuid("contractId"));
if(executingContracts.size() != 1){
//不该出现的情况,需要查明
......@@ -248,33 +239,28 @@ public class ContractServiceImpl implements ContractService {
contractInfoDao.update(contractInfo);
//合同审批通过后,自动新增砂石余量预警设置---变更需要新旧对比,原有的不动,少了的种类废弃预警设置(按理说不可能有),多了的种类新建设置
//TODO
// UUID contractId = contract.getUuid("id");
// List<KObject> detials = contract.get("contractDetail").toList();
// //
// for (KObject detail : detials) {
// String dinasTypeName = detail.get("dinasType").getString("dinasTypeName");
//
// String billType = "合同";
// WarnSettingEntity warnSetting = new WarnSettingEntity();
// warnSetting.setBillType(billType);
// warnSetting.setBillId(contractId);
// warnSetting.setTarget(dinasTypeName);
// warnSetting.setOpen(true);
// warningSettingService.insertWarnSetting(warnSetting);
//
// }
}
private String getContractBaseInfo(KObject contract) {
String projectName = contract.get("project").getString("projectName");
KObject project = contract.get("project");
String projectName = project.getString("projectName");
KObject regionCompany = contract.get("regionCompany");
UUID emptyUUID = UUID.fromString("00000000-0000-0000-0000-000000000000");
UUID regionalCompanyId = regionCompany!=null? regionCompany.getUuid("id"):emptyUUID;
String purchaseSandUnitName = contract.get("purchaseSandUnit").getString("name");
String contractName = contract.getString("contractName");
KObject station = contract.get("station");
UUID stationId = station!=null? station.getUuid("id"):emptyUUID;//
JSONObject jsonObject = new JSONObject();
jsonObject.put("contractName", contractName);
jsonObject.put("projectName", projectName);
jsonObject.put("purchaseSandUnitName", purchaseSandUnitName);
jsonObject.put("regionalCompanyId", regionalCompanyId.toString());
jsonObject.put("stationId", stationId.toString());
return jsonObject.toString();
}
......@@ -297,4 +283,11 @@ public class ContractServiceImpl implements ContractService {
}
@Override
public Object queryWarnSettingStaffByContractId(String contractId) {
List<String> staffIds = warnSettingDao.queryWarnSettingStaffByContractId(contractId);
return ResponseObj.success("查询成功", staffIds);
}
}
......@@ -22,7 +22,7 @@ public class ContractWarnServiceImpl implements ContractWarnService{
private ContractInfoDao contractInfoDao;
@Override
// @Override
public void afterApproved(KObject contract) {
contract.set(ContractConstant.CONTRACT_STATE,ContractStateEnum.EXECUTING.name());
......
......@@ -33,7 +33,7 @@ public class ContractProcessEventListener implements InzBizProcessEventListener
public void afterProcessCompleted(InzBizProcessEvent event) {
//自动新增合同预警条目
if(event.getInzBizProcess().getWorkflowState() == BizProcessState.DONE_WITH_AGREE.getValue()){
contractService.afterSubmitApproved(event.getInzBizProcess().getBizDataObject());
contractService.afterApprovedForInsert(event.getInzBizProcess().getBizDataObject());
}
}
......
......@@ -32,7 +32,7 @@ public class ContractUpdateProcessListener implements InzBizProcessEventListener
public void afterProcessCompleted(InzBizProcessEvent event) {
//自动新增合同预警条目
if(event.getInzBizProcess().getWorkflowState() == BizProcessState.DONE_WITH_AGREE.getValue()){
contractService.afterChangeApproved(event.getInzBizProcess().getBizDataObject());
contractService.afterApprovedForUpdate(event.getInzBizProcess().getBizDataObject());
}
}
......
......@@ -33,17 +33,6 @@ public interface ContractService {
*/
List<KObject> getChangeHistory(UUID id);
/**
* 新增合同工作流
* @param id
*/
void submitFlow(UUID id);
/**
* 变更合同工作流
* @param id
*/
void submitFlowForUpdate(UUID id);
/**
* 根据购砂单位ID 查询所有合同列表里的项目ID列表
......@@ -55,19 +44,31 @@ public interface ContractService {
*/
JSONArray getProjectListByPurSandId(UUID purchaseSandId,UUID projectType,String projectName);
Object queryWarnSettingById(UUID id);
// KObject queryContractById(UUID id);
Object queryWarnSettingStaffByContractId(String fromString);
/**
* 审批通过后的回调-提交
* @param object
* 新增合同-提交工作流
* @param id
*/
void afterSubmitApproved(KObject object);
void submitFlowForInsert(UUID id);
/**
* 审批通过后的回调-变更
* @param object
* 变更合同-提交工作流
* @param id
*/
void afterChangeApproved(KObject object);
void submitFlowForUpdate(UUID id);
/**
* 新增合同- 审批通过后的回调
* @param object afterApprovedForInsert
*/
void afterApprovedForInsert(KObject object);
/**
* 变更合同- 审批通过后的回调
* @param object afterApprovedForUpdate
*/
void afterApprovedForUpdate(KObject object);
Object queryWarnSettingById(UUID id);
}
......@@ -14,5 +14,5 @@ public interface ContractWarnService {
* 审批通过后的回调
* @param object
*/
void afterApproved(KObject object);
// void afterApproved(KObject object);
}
package com.xyst.dinas.contract.task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.beecode.amino.core.Amino;
import com.beecode.bap.scheduler.core.Task;
import com.beecode.bap.scheduler.core.TaskContext;
/**
* 合同过期检查任务
*
* @author Jackpot
* @date 2021年4月7日
*/
public class ContractExpireCheckTask implements Task{
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public void execute(TaskContext arg0) {
// Amino.getApplicationContext().getBean(getClass());
System.out.println("ContractExpireCheckTask.execute....");
}
}
package com.xyst.dinas.contract.task;
import java.util.Optional;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.beecode.amino.metadata.context.ApplicationMetadataContext;
import com.beecode.amino.metadata.runtime.ServiceInitializer;
import com.beecode.bap.scheduler.entity.ScheduleDetail;
import com.beecode.bap.scheduler.entity.TaskDetail;
import com.beecode.bap.scheduler.service.ScheduleService;
public class ContractExpireCheckTaskRegister implements ServiceInitializer{
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ScheduleService scheduleService;
//任务名
private final String EXPIRE_REMIND_TASK_NAME ="ContractExpireCheckTask";
@Override
public void init(ApplicationMetadataContext arg0) {
Optional<ScheduleDetail> Optional = scheduleService.findByName(EXPIRE_REMIND_TASK_NAME);
if (Optional.isPresent()) {
// 如果该租户的库中存在这个轮询任务那么就不再去注册了
scheduleService.removeTask(EXPIRE_REMIND_TASK_NAME);
}
TaskDetail TaskDetail = new TaskDetail(EXPIRE_REMIND_TASK_NAME, ContractExpireCheckTask.class.getName());
// 每天凌晨12点执行调度,如测试可修改为每十五秒:*/15 * * * * ?(表达式由至少6个由空格分隔的时间元素,从左至右可分为秒,分,时,日,月,星期)
// scheduleService.scheduleTask(TaskDetail, "0 0 0 * * ?");
// 测试调度时进行调用
scheduleService.scheduleTask(TaskDetail, "*/10 * * * * ?");
logger.info("合同到期提醒任务初始化成功!");
}
}
......@@ -90,12 +90,12 @@ public class ContractController {
public Object submitFlow(@RequestBody BaseEntity baseEntity) {
UUID id = UUID.fromString(baseEntity.getId());
try{
contractService.submitFlow(id);
contractService.submitFlowForInsert(id);
}catch (Exception e){
e.printStackTrace();
return ResponseObj.error("提交审核提交失败", e.getMessage());
return ResponseObj.error("提交审核失败", e.getMessage());
}
return ResponseObj.success("提交审核提交成功");
return ResponseObj.success("提交审核成功");
}
@PostMapping("/contract/update/submitFlow")
......@@ -105,9 +105,9 @@ public class ContractController {
contractService.submitFlowForUpdate(id);
}catch (Exception e){
e.printStackTrace();
return ResponseObj.error("变更审核提交失败", e.getMessage());
return ResponseObj.error("变更审核失败", e.getMessage());
}
return ResponseObj.success("变更审核提交成功");
return ResponseObj.success("变更审核成功");
}
@PostMapping("/contract/load/last")
......@@ -168,4 +168,16 @@ public class ContractController {
return contractService.queryWarnSettingById(id);
}
/**
* @Description: 根据合同查询预警设置中所有人员
* @param id
* @return return_type
* @throws
*/
@GetMapping("/contract/queryWarnSettingStaffByContractId/{contractId}")
public Object queryWarnSettingStaffByContractId(@PathVariable String contractId) {
Assert.notNull(contractId,"The id must not be null");
return contractService.queryWarnSettingStaffByContractId(contractId);
}
}
\ No newline at end of file
......@@ -68,6 +68,15 @@
</ref>
<description></description>
</field>
<field title='备注'>
<name>memo</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='实际值'>
<name>min</name>
<type>string</type>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>d2d7ed24-6e02-4257-a4cb-ef6e797b3e91</id>
<id>c461433a-b709-47f6-bba5-3b83e6e2c10b</id>
<name>com.xyst.dinas.contract.bill.ContractBill$sequence</name>
<title>合同单据$sequence</title>
<description>合同单据</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>eb5c7a0c-3f4d-4f83-9679-eb2d1e621ef2</id>
<id>e638bfe9-57b0-4f00-a84a-bfa6dd7c0848</id>
<name>com.xyst.dinas.contract.bill.ContractBill$serial</name>
<title>合同单据$serial</title>
<description>合同单据</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>bde748fe-ee10-4027-806a-de8833be4f2d</id>
<id>eba2d45a-7579-497e-b3c9-28dcdbac1ae5</id>
<name>com.xyst.dinas.contract.bill.ContractBill</name>
<title>合同单据</title>
<description>合同单据</description>
......
......@@ -50,9 +50,9 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>target</m:name>
<m:title>预警指标</m:title>
<m:type>string</m:type>
<m:name>billId</m:name>
<m:title>业务id</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
......@@ -60,8 +60,8 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>min</m:name>
<m:title>实际值</m:title>
<m:name>target</m:name>
<m:title>预警指标</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
......@@ -70,9 +70,9 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>billId</m:name>
<m:title>业务id</m:title>
<m:type>uuid</m:type>
<m:name>memo</m:name>
<m:title>备注</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
......@@ -80,8 +80,8 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>personnel</m:name>
<m:title>通知人员</m:title>
<m:name>min</m:name>
<m:title>实际值</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
......@@ -90,8 +90,8 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>memo</m:name>
<m:title>备注</m:title>
<m:name>personnel</m:name>
<m:title>通知人员</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
......
......@@ -70,6 +70,16 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>memo</m:name>
<m:title>备注</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>target</m:name>
<m:title>预警指标</m:title>
<m:type>string</m:type>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>78300200-17a6-45fa-a03a-a9e020f3eaf3</id>
<id>f86667d0-d39a-4f1b-90b9-362b5fdfcf42</id>
<name>com.xyst.dinas.oa.bill.BusinessTripApply$sequence</name>
<title>出差申请$sequence</title>
<description>出差申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>4dd0876c-6030-4fcb-a764-132c138f8747</id>
<id>c6ed834d-1e0d-410d-97ea-9f4683df880c</id>
<name>com.xyst.dinas.oa.bill.BusinessTripApply$serial</name>
<title>出差申请$serial</title>
<description>出差申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>c87da3cc-7053-479a-b5c8-56040f33b3b8</id>
<id>b861545f-04fe-4953-9965-b9497db7b525</id>
<name>com.xyst.dinas.oa.bill.BusinessTripApply</name>
<title>出差申请</title>
<description>出差申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>9f07d98c-e8e9-4fdd-b28c-013ce9c35642</id>
<id>c7bd4ccf-685a-487f-9513-6bffc23c73b9</id>
<name>com.xyst.dinas.oa.bill.ProtocolDocument$sequence</name>
<title>拟文$sequence</title>
<description>拟文</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>db684ed1-350c-434a-89b7-87f83c2c847d</id>
<id>9a872f35-642c-4f5f-be74-498c206a5c11</id>
<name>com.xyst.dinas.oa.bill.ProtocolDocument$serial</name>
<title>拟文$serial</title>
<description>拟文</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>f915cf5c-cdb0-4a43-a834-492e73013f4b</id>
<id>871b3727-5d23-49d8-838b-5e99a436d18d</id>
<name>com.xyst.dinas.oa.bill.ProtocolDocument</name>
<title>拟文</title>
<description>拟文</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>b9ac64cc-5a4d-4b37-baee-043174e5c957</id>
<id>7ade5590-f158-4718-8c41-d5f929880483</id>
<name>com.xyst.dinas.oa.bill.SealBorrow$sequence</name>
<title>证章借出$sequence</title>
<description>证章借出</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>9537c6f7-8529-40e5-9e54-ef95f0e40315</id>
<id>f18b572e-3157-4dae-9de5-e0b1923afbac</id>
<name>com.xyst.dinas.oa.bill.SealBorrow$serial</name>
<title>证章借出$serial</title>
<description>证章借出</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>fd6357af-ed19-4805-9693-d6633e23eace</id>
<id>0847d9d5-d5a9-402d-890c-1cec204389a9</id>
<name>com.xyst.dinas.oa.bill.SealBorrow</name>
<title>证章借出</title>
<description>证章借出</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>47d2d069-06cb-436a-99bb-f23464f931a0</id>
<id>3ade448e-5240-4715-b70d-2cdcabf0cc4d</id>
<name>com.xyst.dinas.oa.bill.UseCarApply$sequence</name>
<title>用车申请$sequence</title>
<description>用车申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>78642653-8d2e-4b8b-beee-8eabf3c511e9</id>
<id>d37f2da3-f7ae-40d6-9383-9ea736fc8fca</id>
<name>com.xyst.dinas.oa.bill.UseCarApply$serial</name>
<title>用车申请$serial</title>
<description>用车申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>748f1a4f-9f07-47e4-8cf3-9bcdef563d6d</id>
<id>f152e8e9-cb3a-4328-a1ea-eaea48aefe65</id>
<name>com.xyst.dinas.oa.bill.UseCarApply</name>
<title>用车申请</title>
<description>用车申请</description>
......
......@@ -32,7 +32,7 @@
</m:annotation>
</m:annotations>
<m:id>23fc82e2-e7b6-49fc-96cc-bb947ba2cc99</m:id>
<m:name>sandMining</m:name>
<m:name>master</m:name>
<m:title>采砂许可证</m:title>
<m:type>com.xyst.dinas.production.datamodel.SandMining</m:type>
<m:description></m:description>
......
......@@ -15,6 +15,7 @@
<dependency>com.beecode.bap.biztrait.datamodel.BasicBillRequirement</dependency>
<dependency>com.xyst.dinas.biz.datamodel.Station</dependency>
<dependency>com.xyst.dinas.biz.datamodel.SandMiningArea</dependency>
<dependency>com.xyst.dinas.production.datamodel.SandMining$SandMiningStationDetail</dependency>
<content>
<m:class>
<m:parents>
......@@ -148,8 +149,8 @@
</m:annotations>
<m:id>923fc243-b92b-45d5-8876-a8cad89b5ac5</m:id>
<m:name>stationDetails</m:name>
<m:title>包含场站</m:title>
<m:type>com.xyst.dinas.biz.datamodel.Station[]</m:type>
<m:title>包含场站子表</m:title>
<m:type>com.xyst.dinas.production.datamodel.SandMining$SandMiningStationDetail[]</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
......
......@@ -107,8 +107,8 @@
</property>
<bag name="stationDetails" lazy="true" fetch="select" inverse="true">
<key column="sand_mining_id" not-null="true" />
<one-to-many entity-name="com.xyst.dinas.project.datamodel.SandMining$SandMiningStationDetail" />
<key column="master_id" not-null="true" />
<one-to-many entity-name="com.xyst.dinas.production.datamodel.SandMining$SandMiningStationDetail" />
</bag>
<property name="sandMiningRange" type="nstring" not-null="false">
<column name="sand_mining_range" length="3000" >
......@@ -142,13 +142,13 @@
</property>
</class>
<class entity-name="com.xyst.dinas.project.datamodel.SandMining$SandMiningStationDetail" table="xyst_dinas_production_sand_mining_station_detail">
<class entity-name="com.xyst.dinas.production.datamodel.SandMining$SandMiningStationDetail" table="xyst_dinas_production_sand_mining_station_detail">
<tuplizer entity-mode="dynamic-map" class="com.beecode.bcp.store.hibernate.KObjectEntityTuplizer"/>
<id name="id" type="uuid-binary" column="id" length="16">
<generator class="assigned" />
</id>
<many-to-one name="sandMining" entity-name="com.xyst.dinas.production.datamodel.SandMining" fetch="select">
<column name="sand_mining_id" not-null="true"/>
<many-to-one name="master" entity-name="com.xyst.dinas.production.datamodel.SandMining" fetch="select">
<column name="master_id" not-null="true"/>
</many-to-one>
<many-to-one name="station" entity-name="com.xyst.dinas.biz.datamodel.Station" fetch="select">
<column name="station_id" not-null="true"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>5111b9d5-3aeb-4e5a-9253-33bd6b8c5f67</id>
<id>02009963-d259-4d65-a69d-f249073dc64d</id>
<name>com.xyst.dinas.project.bill.ProjectFiled$sequence</name>
<title>项目备案$sequence</title>
<description>项目备案</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>66beaa3f-2da9-4cac-99ec-cc3ae6ee989d</id>
<id>c1a3a514-64e1-454e-bd12-3ce2c9b20851</id>
<name>com.xyst.dinas.project.bill.ProjectFiled$serial</name>
<title>项目备案$serial</title>
<description>项目备案</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>94a05ece-77b1-4f6f-b6a4-2b6d4f91d0d6</id>
<id>25266adc-b926-4c38-ac2e-9ca418de5844</id>
<name>com.xyst.dinas.project.bill.ProjectFiled</name>
<title>项目备案</title>
<description>项目备案</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>4e67ff16-13b4-43c3-b56d-18554281b71e</id>
<id>200194e5-237d-4489-961e-1301d8465517</id>
<name>com.xyst.dinas.project.bill.PurchaseSandCompany$sequence</name>
<title>购砂单位$sequence</title>
<description>购砂单位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>ff264e5f-a7b2-49af-99ff-3644c7790c16</id>
<id>995a8bd7-7589-414a-bfb6-8b56560611aa</id>
<name>com.xyst.dinas.project.bill.PurchaseSandCompany$serial</name>
<title>购砂单位$serial</title>
<description>购砂单位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>58c24e8e-aab4-4672-8d2d-ef5c3035126c</id>
<id>8d2ab6d0-f139-47de-8251-4efd9de7f0a6</id>
<name>com.xyst.dinas.project.bill.PurchaseSandCompany</name>
<title>购砂单位</title>
<description>购砂单位</description>
......
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