提交 8fece82b 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 部署微服务接口

上级 4183e242
......@@ -17,6 +17,7 @@ import java.util.List;
@Slf4j
@Import({
com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class,
FeignClientsConfiguration.class
})
@EnableDiscoveryClient
......
......@@ -28,6 +28,7 @@ import java.util.List;
// }
)
@Import({
com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class,
org.springframework.cloud.openfeign.FeignClientsConfiguration.class
})
@EnableAsync
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApply;
......@@ -128,9 +129,7 @@ public class EAMApplyServiceImpl extends ServiceImpl<EAMApplyMapper, EAMApply> i
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMApply et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApplyStateModelLine;
......@@ -125,9 +126,7 @@ public class EAMApplyStateModelLineServiceImpl extends ServiceImpl<EAMApplyState
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMApplyStateModelLine et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApplyStateModel;
......@@ -125,9 +126,7 @@ public class EAMApplyStateModelServiceImpl extends ServiceImpl<EAMApplyStateMode
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMApplyStateModel et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApplyState;
......@@ -122,9 +123,7 @@ public class EAMApplyStateServiceImpl extends ServiceImpl<EAMApplyStateMapper, E
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMApplyState et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApplyType;
......@@ -125,9 +126,7 @@ public class EAMApplyTypeServiceImpl extends ServiceImpl<EAMApplyTypeMapper, EAM
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMApplyType et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMAsset;
......@@ -139,9 +140,7 @@ public class EAMAssetServiceImpl extends ServiceImpl<EAMAssetMapper, EAMAsset> i
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMAsset et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetStateModelLine;
......@@ -125,9 +126,7 @@ public class EAMAssetStateModelLineServiceImpl extends ServiceImpl<EAMAssetState
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMAssetStateModelLine et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetStateModel;
......@@ -125,9 +126,7 @@ public class EAMAssetStateModelServiceImpl extends ServiceImpl<EAMAssetStateMode
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMAssetStateModel et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetState;
......@@ -122,9 +123,7 @@ public class EAMAssetStateServiceImpl extends ServiceImpl<EAMAssetStateMapper, E
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMAssetState et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType;
......@@ -125,9 +126,7 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMAssetType et) {
if (null == et) {
return false;
......
......@@ -103,6 +103,42 @@ public class EAMLocation extends EntityMP implements Serializable {
@JSONField(name = "peamlocationid")
@JsonProperty("peamlocationid")
private String peamlocationid;
/**
* 功能位置状态标识
*/
@TableField(value = "eamlocationstateid")
@JSONField(name = "eamlocationstateid")
@JsonProperty("eamlocationstateid")
private String eamlocationstateid;
/**
* 上级位置
*/
@TableField(exist = false)
@JSONField(name = "peamlocationname")
@JsonProperty("peamlocationname")
private String peamlocationname;
/**
* 功能位置类型
*/
@TableField(exist = false)
@JSONField(name = "eamlocationtypename")
@JsonProperty("eamlocationtypename")
private String eamlocationtypename;
/**
* 功能位置状态
*/
@TableField(exist = false)
@JSONField(name = "eamlocationstatename")
@JsonProperty("eamlocationstatename")
private String eamlocationstatename;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.location.domain.EAMLocationState eamlocationstate;
/**
*
......@@ -146,6 +182,14 @@ public class EAMLocation extends EntityMP implements Serializable {
this.modify("peamlocationid",peamlocationid);
}
/**
* 设置 [功能位置状态标识]
*/
public void setEamlocationstateid(String eamlocationstateid){
this.eamlocationstateid = eamlocationstateid ;
this.modify("eamlocationstateid",eamlocationstateid);
}
}
......
......@@ -96,6 +96,13 @@ public class EAMLocationType extends EntityMP implements Serializable {
@JSONField(name = "eamlocationstatemodelid")
@JsonProperty("eamlocationstatemodelid")
private String eamlocationstatemodelid;
/**
* 功能位置状态模型
*/
@TableField(exist = false)
@JSONField(name = "eamlocationstatemodelname")
@JsonProperty("eamlocationstatemodelname")
private String eamlocationstatemodelname;
/**
*
......
......@@ -48,6 +48,55 @@ public class EAMLocationSearchContext extends QueryWrapperContext<EAMLocation> {
this.getSearchCond().eq("peamlocationid", n_peamlocationid_eq);
}
}
private String n_eamlocationstateid_eq;//[功能位置状态标识]
public void setN_eamlocationstateid_eq(String n_eamlocationstateid_eq) {
this.n_eamlocationstateid_eq = n_eamlocationstateid_eq;
if(!ObjectUtils.isEmpty(this.n_eamlocationstateid_eq)){
this.getSearchCond().eq("eamlocationstateid", n_eamlocationstateid_eq);
}
}
private String n_peamlocationname_eq;//[上级位置]
public void setN_peamlocationname_eq(String n_peamlocationname_eq) {
this.n_peamlocationname_eq = n_peamlocationname_eq;
if(!ObjectUtils.isEmpty(this.n_peamlocationname_eq)){
this.getSearchCond().eq("peamlocationname", n_peamlocationname_eq);
}
}
private String n_peamlocationname_like;//[上级位置]
public void setN_peamlocationname_like(String n_peamlocationname_like) {
this.n_peamlocationname_like = n_peamlocationname_like;
if(!ObjectUtils.isEmpty(this.n_peamlocationname_like)){
this.getSearchCond().like("peamlocationname", n_peamlocationname_like);
}
}
private String n_eamlocationtypename_eq;//[功能位置类型]
public void setN_eamlocationtypename_eq(String n_eamlocationtypename_eq) {
this.n_eamlocationtypename_eq = n_eamlocationtypename_eq;
if(!ObjectUtils.isEmpty(this.n_eamlocationtypename_eq)){
this.getSearchCond().eq("eamlocationtypename", n_eamlocationtypename_eq);
}
}
private String n_eamlocationtypename_like;//[功能位置类型]
public void setN_eamlocationtypename_like(String n_eamlocationtypename_like) {
this.n_eamlocationtypename_like = n_eamlocationtypename_like;
if(!ObjectUtils.isEmpty(this.n_eamlocationtypename_like)){
this.getSearchCond().like("eamlocationtypename", n_eamlocationtypename_like);
}
}
private String n_eamlocationstatename_eq;//[功能位置状态]
public void setN_eamlocationstatename_eq(String n_eamlocationstatename_eq) {
this.n_eamlocationstatename_eq = n_eamlocationstatename_eq;
if(!ObjectUtils.isEmpty(this.n_eamlocationstatename_eq)){
this.getSearchCond().eq("eamlocationstatename", n_eamlocationstatename_eq);
}
}
private String n_eamlocationstatename_like;//[功能位置状态]
public void setN_eamlocationstatename_like(String n_eamlocationstatename_like) {
this.n_eamlocationstatename_like = n_eamlocationstatename_like;
if(!ObjectUtils.isEmpty(this.n_eamlocationstatename_like)){
this.getSearchCond().like("eamlocationstatename", n_eamlocationstatename_like);
}
}
/**
* 启用快速搜索
......
......@@ -41,6 +41,20 @@ public class EAMLocationTypeSearchContext extends QueryWrapperContext<EAMLocatio
this.getSearchCond().eq("eamlocationstatemodelid", n_eamlocationstatemodelid_eq);
}
}
private String n_eamlocationstatemodelname_eq;//[功能位置状态模型]
public void setN_eamlocationstatemodelname_eq(String n_eamlocationstatemodelname_eq) {
this.n_eamlocationstatemodelname_eq = n_eamlocationstatemodelname_eq;
if(!ObjectUtils.isEmpty(this.n_eamlocationstatemodelname_eq)){
this.getSearchCond().eq("eamlocationstatemodelname", n_eamlocationstatemodelname_eq);
}
}
private String n_eamlocationstatemodelname_like;//[功能位置状态模型]
public void setN_eamlocationstatemodelname_like(String n_eamlocationstatemodelname_like) {
this.n_eamlocationstatemodelname_like = n_eamlocationstatemodelname_like;
if(!ObjectUtils.isEmpty(this.n_eamlocationstatemodelname_like)){
this.getSearchCond().like("eamlocationstatemodelname", n_eamlocationstatemodelname_like);
}
}
/**
* 启用快速搜索
......
......@@ -62,6 +62,8 @@ public interface EAMLocationMapper extends BaseMapper<EAMLocation>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<EAMLocation> selectByEamlocationstateid(@Param("eamlocationstateid") Serializable eamlocationstateid) ;
List<EAMLocation> selectByEamlocationtypeid(@Param("eamlocationtypeid") Serializable eamlocationtypeid) ;
List<EAMLocation> selectByPeamlocationid(@Param("eamlocationid") Serializable eamlocationid) ;
......
......@@ -37,6 +37,8 @@ public interface IEAMLocationService extends IService<EAMLocation>{
boolean save(EAMLocation et) ;
void saveBatch(List<EAMLocation> list) ;
Page<EAMLocation> searchDefault(EAMLocationSearchContext context) ;
List<EAMLocation> selectByEamlocationstateid(String eamlocationstateid) ;
void removeByEamlocationstateid(String eamlocationstateid) ;
List<EAMLocation> selectByEamlocationtypeid(String eamlocationtypeid) ;
void removeByEamlocationtypeid(String eamlocationtypeid) ;
List<EAMLocation> selectByPeamlocationid(String eamlocationid) ;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.location.domain.EAMLocation;
......@@ -64,6 +65,9 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
protected cn.ibizlab.assetmanagement.core.workorder.service.IEAMWorkOrderService eamworkorderService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationStateService eamlocationstateService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationTypeService eamlocationtypeService;
protected int batchSize = 500;
......@@ -71,6 +75,7 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
@Override
@Transactional
public boolean create(EAMLocation et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamlocationid()),et);
......@@ -79,12 +84,14 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
@Override
public void createBatch(List<EAMLocation> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMLocation et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamlocationid",et.getEamlocationid())))
return false;
CachedBeanCopier.copy(get(et.getEamlocationid()),et);
......@@ -93,6 +100,7 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
@Override
public void updateBatch(List<EAMLocation> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
......@@ -123,6 +131,7 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
@Override
public EAMLocation getDraft(EAMLocation et) {
fillParentData(et);
return et;
}
......@@ -139,9 +148,7 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMLocation et) {
if (null == et) {
return false;
......@@ -152,16 +159,28 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
@Override
public boolean saveBatch(Collection<EAMLocation> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMLocation> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<EAMLocation> selectByEamlocationstateid(String eamlocationstateid) {
return baseMapper.selectByEamlocationstateid(eamlocationstateid);
}
@Override
public void removeByEamlocationstateid(String eamlocationstateid) {
this.remove(new QueryWrapper<EAMLocation>().eq("eamlocationstateid",eamlocationstateid));
}
@Override
public List<EAMLocation> selectByEamlocationtypeid(String eamlocationtypeid) {
return baseMapper.selectByEamlocationtypeid(eamlocationtypeid);
......@@ -194,6 +213,42 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMLocation et){
//实体关系[DER1N_EAMLOCATION_EAMLOCATIONSTATE_EAMLOCATIONSTATEID]
if(!ObjectUtils.isEmpty(et.getEamlocationstateid())){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocationState eamlocationstate=et.getEamlocationstate();
if(ObjectUtils.isEmpty(eamlocationstate)){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocationState majorEntity=eamlocationstateService.get(et.getEamlocationstateid());
et.setEamlocationstate(majorEntity);
eamlocationstate=majorEntity;
}
et.setEamlocationstatename(eamlocationstate.getEamlocationstatename());
}
//实体关系[DER1N_EAMLOCATION_EAMLOCATIONTYPE_EAMLOCATIONTYPEID]
if(!ObjectUtils.isEmpty(et.getEamlocationtypeid())){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocationType eamlocationtype=et.getEamlocationtype();
if(ObjectUtils.isEmpty(eamlocationtype)){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocationType majorEntity=eamlocationtypeService.get(et.getEamlocationtypeid());
et.setEamlocationtype(majorEntity);
eamlocationtype=majorEntity;
}
et.setEamlocationtypename(eamlocationtype.getEamlocationtypename());
}
//实体关系[DER1N_EAMLOCATION_EAMLOCATION_PEAMLOCATIONID]
if(!ObjectUtils.isEmpty(et.getPeamlocationid())){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocation peamlocation=et.getPeamlocation();
if(ObjectUtils.isEmpty(peamlocation)){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocation majorEntity=eamlocationService.get(et.getPeamlocationid());
et.setPeamlocation(majorEntity);
peamlocation=majorEntity;
}
et.setPeamlocationname(peamlocation.getEamlocationname());
}
}
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.location.domain.EAMLocationStateModelLine;
......@@ -130,9 +131,7 @@ public class EAMLocationStateModelLineServiceImpl extends ServiceImpl<EAMLocatio
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMLocationStateModelLine et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.location.domain.EAMLocationStateModel;
......@@ -125,9 +126,7 @@ public class EAMLocationStateModelServiceImpl extends ServiceImpl<EAMLocationSta
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMLocationStateModel et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.location.domain.EAMLocationState;
......@@ -48,6 +49,9 @@ public class EAMLocationStateServiceImpl extends ServiceImpl<EAMLocationStateMap
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationStateModelLineService eamlocationstatemodellineService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationService eamlocationService;
protected int batchSize = 500;
......@@ -122,9 +126,7 @@ public class EAMLocationStateServiceImpl extends ServiceImpl<EAMLocationStateMap
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMLocationState et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.location.domain.EAMLocationType;
......@@ -57,6 +58,7 @@ public class EAMLocationTypeServiceImpl extends ServiceImpl<EAMLocationTypeMappe
@Override
@Transactional
public boolean create(EAMLocationType et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamlocationtypeid()),et);
......@@ -65,12 +67,14 @@ public class EAMLocationTypeServiceImpl extends ServiceImpl<EAMLocationTypeMappe
@Override
public void createBatch(List<EAMLocationType> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMLocationType et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamlocationtypeid",et.getEamlocationtypeid())))
return false;
CachedBeanCopier.copy(get(et.getEamlocationtypeid()),et);
......@@ -79,6 +83,7 @@ public class EAMLocationTypeServiceImpl extends ServiceImpl<EAMLocationTypeMappe
@Override
public void updateBatch(List<EAMLocationType> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
......@@ -109,6 +114,7 @@ public class EAMLocationTypeServiceImpl extends ServiceImpl<EAMLocationTypeMappe
@Override
public EAMLocationType getDraft(EAMLocationType et) {
fillParentData(et);
return et;
}
......@@ -125,9 +131,7 @@ public class EAMLocationTypeServiceImpl extends ServiceImpl<EAMLocationTypeMappe
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMLocationType et) {
if (null == et) {
return false;
......@@ -138,12 +142,14 @@ public class EAMLocationTypeServiceImpl extends ServiceImpl<EAMLocationTypeMappe
@Override
public boolean saveBatch(Collection<EAMLocationType> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMLocationType> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
......@@ -170,6 +176,22 @@ public class EAMLocationTypeServiceImpl extends ServiceImpl<EAMLocationTypeMappe
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMLocationType et){
//实体关系[DER1N_EAMLOCATIONTYPE_EAMLOCATIONSTATEMODEL_EAMLOCATIONSTATEMODELID]
if(!ObjectUtils.isEmpty(et.getEamlocationstatemodelid())){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocationStateModel eamlocationstatemodel=et.getEamlocationstatemodel();
if(ObjectUtils.isEmpty(eamlocationstatemodel)){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocationStateModel majorEntity=eamlocationstatemodelService.get(et.getEamlocationstatemodelid());
et.setEamlocationstatemodel(majorEntity);
eamlocationstatemodel=majorEntity;
}
et.setEamlocationstatemodelname(eamlocationstatemodel.getEamlocationstatemodelname());
}
}
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanCDT;
......@@ -122,9 +123,7 @@ public class EAMPlanCDTServiceImpl extends ServiceImpl<EAMPlanCDTMapper, EAMPlan
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMPlanCDT et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanLine;
......@@ -128,9 +129,7 @@ public class EAMPlanLineServiceImpl extends ServiceImpl<EAMPlanLineMapper, EAMPl
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMPlanLine et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanSchedule;
......@@ -122,9 +123,7 @@ public class EAMPlanScheduleServiceImpl extends ServiceImpl<EAMPlanScheduleMappe
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMPlanSchedule et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlan;
......@@ -134,9 +135,7 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMPlan et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOStateModelLine;
......@@ -125,9 +126,7 @@ public class EAMWOStateModelLineServiceImpl extends ServiceImpl<EAMWOStateModelL
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMWOStateModelLine et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOStateModel;
......@@ -125,9 +126,7 @@ public class EAMWOStateModelServiceImpl extends ServiceImpl<EAMWOStateModelMappe
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMWOStateModel et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOState;
......@@ -122,9 +123,7 @@ public class EAMWOStateServiceImpl extends ServiceImpl<EAMWOStateMapper, EAMWOSt
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMWOState et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOType;
......@@ -125,9 +126,7 @@ public class EAMWOTypeServiceImpl extends ServiceImpl<EAMWOTypeMapper, EAMWOType
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMWOType et) {
if (null == et) {
return false;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWorkOrder;
......@@ -130,9 +131,7 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Transactional
public boolean saveOrUpdate(EAMWorkOrder et) {
if (null == et) {
return false;
......
......@@ -228,7 +228,7 @@
<!--输出实体[EAMLOCATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-15-11">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-42-11">
<createTable tableName="EAMLOCATION">
<column name="EAMLOCATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMLOCATION_EAMLOCATIONID"/>
......@@ -247,12 +247,14 @@
</column>
<column name="PEAMLOCATIONID" remarks="" type="VARCHAR(100)">
</column>
<column name="EAMLOCATIONSTATEID" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMLOCATIONSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-27-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-29-12">
<createTable tableName="EAMLOCATIONSTATE">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -296,7 +298,7 @@
<!--输出实体[EAMLOCATIONSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-16-14">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-18-14">
<createTable tableName="EAMLOCATIONSTATEMODELLINE">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -320,7 +322,7 @@
<!--输出实体[EAMLOCATIONTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationtype-8-15">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationtype-15-15">
<createTable tableName="EAMLOCATIONTYPE">
<column name="EAMLOCATIONTYPENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -589,68 +591,71 @@
<addForeignKeyConstraint baseColumnNames="EAMASSETSTATEMODELID" baseTableName="EAMASSETTYPE" constraintName="DER1N_EAMASSETTYPE_EAMASSETSTA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETSTATEMODELID" referencedTableName="EAMASSETSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-15-37">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-42-37">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATIONS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEID" referencedTableName="EAMLOCATIONSTATE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-42-38">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONTYPEID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATIONT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONTYPEID" referencedTableName="EAMLOCATIONTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-15-38">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-42-39">
<addForeignKeyConstraint baseColumnNames="PEAMLOCATIONID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATION_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATIONSTATE]外键关系 -->
<!--输出实体[EAMLOCATIONSTATEMODEL]外键关系 -->
<!--输出实体[EAMLOCATIONSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationstatemodelline-16-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationstatemodelline-18-40">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEMODELID" baseTableName="EAMLOCATIONSTATEMODELLINE" constraintName="DER1N_EAMLOCATIONSTATEMODELLIN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEMODELID" referencedTableName="EAMLOCATIONSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATIONTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationtype-8-41">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationtype-15-42">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEMODELID" baseTableName="EAMLOCATIONTYPE" constraintName="DER1N_EAMLOCATIONTYPE_EAMLOCAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEMODELID" referencedTableName="EAMLOCATIONSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMPLAN]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-10-42">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-10-43">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMASSET_ASSETID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-10-43">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-10-44">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMLOCATION_EAML" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANCDT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplancdt-6-44">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplancdt-6-45">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANCDT" constraintName="DER1N_EAMPLANCDT_EAMPLAN_EAMPL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-45">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-46">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMASSET_ASS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-46">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-47">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMLOCATION_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-47">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-48">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMPLAN_EAMP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANSCHEDULE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanschedule-6-48">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanschedule-6-49">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANSCHEDULE" constraintName="DER1N_EAMPLANSCHEDULE_EAMPLAN_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMWOSTATE]外键关系 -->
<!--输出实体[EAMWOSTATEMODEL]外键关系 -->
<!--输出实体[EAMWOSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwostatemodelline-7-49">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwostatemodelline-7-50">
<addForeignKeyConstraint baseColumnNames="EAMWOSTATEMODELID" baseTableName="EAMWOSTATEMODELLINE" constraintName="DER1N_EAMWOSTATEMODELLINE_EAMW" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOSTATEMODELID" referencedTableName="EAMWOSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMWOTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwotype-7-51">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwotype-7-52">
<addForeignKeyConstraint baseColumnNames="EAMWOSTATEMODELID" baseTableName="EAMWOTYPE" constraintName="DER1N_EAMWOTYPE_EAMWOSTATEMODE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOSTATEMODELID" referencedTableName="EAMWOSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMWORKORDER]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-52">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-53">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMASSET_AS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-53">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-54">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMLOCATION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-54">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-55">
<addForeignKeyConstraint baseColumnNames="PWORKORDERID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWORKORDE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WORKORDERID" referencedTableName="WORKORDER" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-55">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-56">
<addForeignKeyConstraint baseColumnNames="EAMWOTYPEID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWOTYPE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOTYPEID" referencedTableName="EAMWOTYPE" validate="true"/>
</changeSet>
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMLocationResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONTYPEID`, t1.`PEAMLOCATIONID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1 ) t1 where eamlocationid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`PEAMLOCATIONID`, t11.`EAMLOCATIONNAME` AS `PEAMLOCATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1 LEFT JOIN EAMLOCATION t11 ON t1.PEAMLOCATIONID = t11.EAMLOCATIONID LEFT JOIN EAMLOCATIONTYPE t21 ON t1.EAMLOCATIONTYPEID = t21.EAMLOCATIONTYPEID LEFT JOIN EAMLOCATIONSTATE t31 ON t1.EAMLOCATIONSTATEID = t31.EAMLOCATIONSTATEID ) t1 where eamlocationid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -13,14 +13,24 @@
<id property="eamlocationid" column="eamlocationid" /><!--主键字段映射-->
<result property="eamlocationtypeid" column="eamlocationtypeid" />
<result property="peamlocationid" column="peamlocationid" />
<result property="eamlocationstateid" column="eamlocationstateid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamlocationstate" javaType="cn.ibizlab.assetmanagement.core.location.domain.EAMLocationState" column="eamlocationstateid" select="cn.ibizlab.assetmanagement.core.location.mapper.EAMLocationStateMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamlocationtype" javaType="cn.ibizlab.assetmanagement.core.location.domain.EAMLocationType" column="eamlocationtypeid" select="cn.ibizlab.assetmanagement.core.location.mapper.EAMLocationTypeMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="peamlocation" javaType="cn.ibizlab.assetmanagement.core.location.domain.EAMLocation" column="peamlocationid" select="cn.ibizlab.assetmanagement.core.location.mapper.EAMLocationMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMLOCATION_EAMLOCATIONSTATE_EAMLOCATIONSTATEID] -->
<select id="selectByEamlocationstateid" resultMap="EAMLocationResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationstateid=#{eamlocationstateid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMLOCATION_EAMLOCATIONTYPE_EAMLOCATIONTYPEID] -->
<select id="selectByEamlocationtypeid" resultMap="EAMLocationResultMap">
select t1.* from (
......@@ -47,12 +57,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONTYPEID`, t1.`PEAMLOCATIONID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`PEAMLOCATIONID`, t11.`EAMLOCATIONNAME` AS `PEAMLOCATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1 LEFT JOIN EAMLOCATION t11 ON t1.PEAMLOCATIONID = t11.EAMLOCATIONID LEFT JOIN EAMLOCATIONTYPE t21 ON t1.EAMLOCATIONTYPEID = t21.EAMLOCATIONTYPEID LEFT JOIN EAMLOCATIONSTATE t31 ON t1.EAMLOCATIONSTATEID = t31.EAMLOCATIONSTATEID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONTYPEID`, t1.`PEAMLOCATIONID`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`PEAMLOCATIONID`, t11.`EAMLOCATIONNAME` AS `PEAMLOCATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1 LEFT JOIN EAMLOCATION t11 ON t1.PEAMLOCATIONID = t11.EAMLOCATIONID LEFT JOIN EAMLOCATIONTYPE t21 ON t1.EAMLOCATIONTYPEID = t21.EAMLOCATIONTYPEID LEFT JOIN EAMLOCATIONSTATE t31 ON t1.EAMLOCATIONSTATEID = t31.EAMLOCATIONSTATEID
]]>
</sql>
</mapper>
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMLocationTypeResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONSTATEMODELID`, t1.`EAMLOCATIONTYPEID`, t1.`EAMLOCATIONTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATIONTYPE` t1 ) t1 where eamlocationtypeid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONSTATEMODELID`, t11.`EAMLOCATIONSTATEMODELNAME`, t1.`EAMLOCATIONTYPEID`, t1.`EAMLOCATIONTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATIONTYPE` t1 LEFT JOIN EAMLOCATIONSTATEMODEL t11 ON t1.EAMLOCATIONSTATEMODELID = t11.EAMLOCATIONSTATEMODELID ) t1 where eamlocationtypeid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -37,12 +37,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONSTATEMODELID`, t1.`EAMLOCATIONTYPEID`, t1.`EAMLOCATIONTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATIONTYPE` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONSTATEMODELID`, t11.`EAMLOCATIONSTATEMODELNAME`, t1.`EAMLOCATIONTYPEID`, t1.`EAMLOCATIONTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATIONTYPE` t1 LEFT JOIN EAMLOCATIONSTATEMODEL t11 ON t1.EAMLOCATIONSTATEMODELID = t11.EAMLOCATIONSTATEMODELID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONSTATEMODELID`, t1.`EAMLOCATIONTYPEID`, t1.`EAMLOCATIONTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATIONTYPE` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONSTATEMODELID`, t11.`EAMLOCATIONSTATEMODELNAME`, t1.`EAMLOCATIONTYPEID`, t1.`EAMLOCATIONTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATIONTYPE` t1 LEFT JOIN EAMLOCATIONSTATEMODEL t11 ON t1.EAMLOCATIONSTATEMODELID = t11.EAMLOCATIONSTATEMODELID
]]>
</sql>
</mapper>
......
......@@ -49,7 +49,7 @@
{
"appid":"AssetManagement",
"appname":"资产管理",
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem1" , "name":"功能位置" , "items":[{ "id":"menuitem6" , "name":"功能位置状态管理" },{ "id":"menuitem7" , "name":"功能位置状态模型管理" }]},{ "id":"menuitem2" , "name":"资产管理" },{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem4" , "name":"工单管理" },{ "id":"menuitem5" , "name":"维护计划" }]}] }]
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem1" , "name":"功能位置" , "items":[{ "id":"menuitem6" , "name":"功能位置状态管理" },{ "id":"menuitem7" , "name":"功能位置状态模型管理" },{ "id":"menuitem8" , "name":"功能位置类型" },{ "id":"menuitem9" , "name":"功能位置" }]},{ "id":"menuitem2" , "name":"资产管理" },{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem4" , "name":"工单管理" },{ "id":"menuitem5" , "name":"维护计划" }]}] }]
}
]
}
......@@ -20,7 +20,7 @@
<properties>
<!-- Spring Cloud Alibaba(2.1.x.RELEASE) & Spring Cloud(Spring Cloud Greenwich) & Spring Boot(2.1.x.RELEASE) compatibility -->
<spring-cloud-alibaba.version>2.1.1.RELEASE</spring-cloud-alibaba.version>
<spring-cloud-alibaba.version>2.2.1.RELEASE</spring-cloud-alibaba.version>
<spring-cloud-openfeign.version>2.2.1.RELEASE</spring-cloud-openfeign.version>
......@@ -80,6 +80,12 @@
<!-- eureka微服务注册中心 -->
<eureka-client.version>2.2.1.RELEASE</eureka-client.version>
<!-- 阿里sentinel熔断器 -->
<alibaba-sentinel.version>2.1.1.RELEASE</alibaba-sentinel.version>
<!-- 阿里seata分布式事务 -->
<alibaba-seata.version>1.3.0</alibaba-seata.version>
</properties>
......@@ -289,6 +295,7 @@
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>${alibaba-sentinel.version}</version>
</dependency>
<!-- Lombok -->
......@@ -329,6 +336,31 @@
</dependency>
<!-- 阿里seata分布式事务 -->
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>${alibaba-seata.version}</version>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
<version> ${spring-cloud-alibaba.version}</version>
<exclusions>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
......@@ -89,6 +89,38 @@ public class EAMLocationDTO extends DTOBase implements Serializable {
@JsonProperty("peamlocationid")
private String peamlocationid;
/**
* 属性 [EAMLOCATIONSTATEID]
*
*/
@JSONField(name = "eamlocationstateid")
@JsonProperty("eamlocationstateid")
private String eamlocationstateid;
/**
* 属性 [PEAMLOCATIONNAME]
*
*/
@JSONField(name = "peamlocationname")
@JsonProperty("peamlocationname")
private String peamlocationname;
/**
* 属性 [EAMLOCATIONTYPENAME]
*
*/
@JSONField(name = "eamlocationtypename")
@JsonProperty("eamlocationtypename")
private String eamlocationtypename;
/**
* 属性 [EAMLOCATIONSTATENAME]
*
*/
@JSONField(name = "eamlocationstatename")
@JsonProperty("eamlocationstatename")
private String eamlocationstatename;
/**
* 设置 [EAMLOCATIONNAME]
......@@ -114,6 +146,14 @@ public class EAMLocationDTO extends DTOBase implements Serializable {
this.modify("peamlocationid",peamlocationid);
}
/**
* 设置 [EAMLOCATIONSTATEID]
*/
public void setEamlocationstateid(String eamlocationstateid){
this.eamlocationstateid = eamlocationstateid ;
this.modify("eamlocationstateid",eamlocationstateid);
}
}
......@@ -81,6 +81,14 @@ public class EAMLocationTypeDTO extends DTOBase implements Serializable {
@JsonProperty("eamlocationstatemodelid")
private String eamlocationstatemodelid;
/**
* 属性 [EAMLOCATIONSTATEMODELNAME]
*
*/
@JSONField(name = "eamlocationstatemodelname")
@JsonProperty("eamlocationstatemodelname")
private String eamlocationstatemodelname;
/**
* 设置 [EAMLOCATIONTYPENAME]
......
......@@ -33,6 +33,7 @@ import java.util.List;
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
})
@Import({
com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class,
org.springframework.cloud.openfeign.FeignClientsConfiguration.class
})
@EnableFeignClients(basePackages = {"cn.ibizlab.assetmanagement" })
......
......@@ -2,6 +2,8 @@ package cn.ibizlab.assetmanagement.util.security;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Date;
public interface AuthTokenUtil {
String generateToken(UserDetails userDetails);
......@@ -10,5 +12,7 @@ public interface AuthTokenUtil {
String getUsernameFromToken(String token);
Date getExpirationDateFromToken(String token) ;
}
#缓存、数据源
spring:
cache:
......@@ -102,3 +103,20 @@ server:
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
seata:
enabled: false #是否开启全局事务
application-id: iBizAssetManagement #服务标识
tx-service-group: iBizAssetManagementgroup #事务组
service:
vgroup-mapping:
iBizAssetManagementgroup: default #指定事务组对应的Tc Server集群
registry:
type: nacos #注册中心
nacos:
application: seata-server #Tc Server服务标识
server-addr: localhost #注册中心地址
group: DEFAULT_GROUP #服务组
namespace: #服务命名空间
userName: "" #用户名
password: "" #密码
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册