| | |
| | | package com.highdatas.mdm.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.highdatas.mdm.entity.Flows; |
| | | import com.highdatas.mdm.entity.MaintainField; |
| | | import com.highdatas.mdm.mapper.FlowsMapper; |
| | | import com.highdatas.mdm.mapper.SysFieldMapper; |
| | | import com.highdatas.mdm.pojo.ActivitiStatus; |
| | | import com.highdatas.mdm.service.IFlowsService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.highdatas.mdm.service.IMaintainFieldService; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class FlowsServiceImpl extends ServiceImpl<FlowsMapper, Flows> implements IFlowsService { |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | | @Autowired |
| | | SysFieldMapper fieldMapper; |
| | | @Override |
| | | public MaintainField createNowVerion(String tableName, String maintainId, String userId) { |
| | | MaintainField nowMaintain = maintainFieldService.getNextMaintain(tableName, userId); |
| | | // 搬运新版本字段 |
| | | String maintainParams; |
| | | if (StringUtils.isEmpty(maintainId)) { |
| | | maintainParams = "maintain_field_id is null and table_name = " + DbUtils.quotedStr(tableName); |
| | | }else { |
| | | maintainParams = "maintain_field_id = " + DbUtils.quotedStr(maintainId); |
| | | } |
| | | |
| | | fieldMapper.tansNewVersion(DbUtils.quotedStr(nowMaintain.getId()), maintainParams); |
| | | return nowMaintain; |
| | | } |
| | | |
| | | @Override |
| | | public ActivitiStatus getStatusByBusinessId(String businessId) { |
| | | Flows flows = selectOne(new EntityWrapper<Flows>().eq("business_id", businessId)); |
| | | if (flows == null){ |
| | | return null; |
| | | } |
| | | return flows.getStatus(); |
| | | } |
| | | } |