提交 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;
......
......@@ -28,22 +28,22 @@
<select id="selectByEamapplytypeid" resultMap="EAMApplyResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamapplytypeid=#{eamapplytypeid}
) t1
where eamapplytypeid=#{eamapplytypeid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMAPPLY_EAMASSET_ASSETID] -->
<select id="selectByAssetid" resultMap="EAMApplyResultMap">
select t1.* from (
<include refid="Default" />
) t1
where assetid=#{assetid}
) t1
where assetid=#{assetid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMAPPLY_EAMLOCATION_EAMLOCATIONID] -->
<select id="selectByEamlocationid" resultMap="EAMApplyResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationid=#{eamlocationid}
) t1
where eamlocationid=#{eamlocationid}
</select>
<!--数据集合[Default]-->
......
......@@ -25,15 +25,15 @@
<select id="selectByEamapplystatemodelid" resultMap="EAMApplyStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamapplystatemodelid=#{eamapplystatemodelid}
) t1
where eamapplystatemodelid=#{eamapplystatemodelid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMAPPLYSTATEMODELLINE_EAMAPPLYSTATE_EAMAPPLYSTATEID] -->
<select id="selectByEamapplystateid" resultMap="EAMApplyStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamapplystateid=#{eamapplystateid}
) t1
where eamapplystateid=#{eamapplystateid}
</select>
<!--数据集合[Default]-->
......
......@@ -22,8 +22,8 @@
<select id="selectByEamapplystatemodelid" resultMap="EAMApplyTypeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamapplystatemodelid=#{eamapplystatemodelid}
) t1
where eamapplystatemodelid=#{eamapplystatemodelid}
</select>
<!--数据集合[Default]-->
......
......@@ -28,22 +28,22 @@
<select id="selectByEamassettypeid" resultMap="EAMAssetResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamassettypeid=#{eamassettypeid}
) t1
where eamassettypeid=#{eamassettypeid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMASSET_EAMASSET_PASSETID] -->
<select id="selectByPassetid" resultMap="EAMAssetResultMap">
select t1.* from (
<include refid="Default" />
) t1
where passetid=#{assetid}
) t1
where passetid=#{assetid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMASSET_EAMLOCATION_EAMLOCATIONID] -->
<select id="selectByEamlocationid" resultMap="EAMAssetResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationid=#{eamlocationid}
) t1
where eamlocationid=#{eamlocationid}
</select>
<!--数据集合[Default]-->
......
......@@ -25,15 +25,15 @@
<select id="selectByEamassetstatemodelid" resultMap="EAMAssetStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamassetstatemodelid=#{eamassetstatemodelid}
) t1
where eamassetstatemodelid=#{eamassetstatemodelid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMASSETSTATEMODELLINE_EAMASSETSTATE_EAMASSETSTATEID] -->
<select id="selectByEamassetstateid" resultMap="EAMAssetStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamassetstateid=#{eamassetstateid}
) t1
where eamassetstateid=#{eamassetstateid}
</select>
<!--数据集合[Default]-->
......
......@@ -22,8 +22,8 @@
<select id="selectByEamassetstatemodelid" resultMap="EAMAssetTypeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamassetstatemodelid=#{eamassetstatemodelid}
) t1
where eamassetstatemodelid=#{eamassetstatemodelid}
</select>
<!--数据集合[Default]-->
......
......@@ -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,27 +13,37 @@
<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 (
<include refid="Default" />
) t1
where eamlocationtypeid=#{eamlocationtypeid}
) t1
where eamlocationtypeid=#{eamlocationtypeid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMLOCATION_EAMLOCATION_PEAMLOCATIONID] -->
<select id="selectByPeamlocationid" resultMap="EAMLocationResultMap">
select t1.* from (
<include refid="Default" />
) t1
where peamlocationid=#{eamlocationid}
) t1
where peamlocationid=#{eamlocationid}
</select>
<!--数据集合[Default]-->
......@@ -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>
......
......@@ -25,15 +25,15 @@
<select id="selectByEamlocationstatemodelid" resultMap="EAMLocationStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationstatemodelid=#{eamlocationstatemodelid}
) t1
where eamlocationstatemodelid=#{eamlocationstatemodelid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMLOCATIONSTATEMODELLINE_EAMLOCATIONSTATE_EAMLOCATIONSTATEID] -->
<select id="selectByEamlocationstateid" resultMap="EAMLocationStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationstateid=#{eamlocationstateid}
) t1
where eamlocationstateid=#{eamlocationstateid}
</select>
<!--数据集合[Default]-->
......
......@@ -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自动处理映射关系 -->
......@@ -22,8 +22,8 @@
<select id="selectByEamlocationstatemodelid" resultMap="EAMLocationTypeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationstatemodelid=#{eamlocationstatemodelid}
) t1
where eamlocationstatemodelid=#{eamlocationstatemodelid}
</select>
<!--数据集合[Default]-->
......@@ -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>
......
......@@ -25,15 +25,15 @@
<select id="selectByAssetid" resultMap="EAMPlanResultMap">
select t1.* from (
<include refid="Default" />
) t1
where assetid=#{assetid}
) t1
where assetid=#{assetid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMPLAN_EAMLOCATION_EAMLOCATIONID] -->
<select id="selectByEamlocationid" resultMap="EAMPlanResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationid=#{eamlocationid}
) t1
where eamlocationid=#{eamlocationid}
</select>
<!--数据集合[Default]-->
......
......@@ -22,8 +22,8 @@
<select id="selectByEamplanid" resultMap="EAMPlanCDTResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamplanid=#{eamplanid}
) t1
where eamplanid=#{eamplanid}
</select>
<!--数据集合[Default]-->
......
......@@ -28,22 +28,22 @@
<select id="selectByAssetid" resultMap="EAMPlanLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where assetid=#{assetid}
) t1
where assetid=#{assetid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMPLANLINE_EAMLOCATION_EAMLOCATIONID] -->
<select id="selectByEamlocationid" resultMap="EAMPlanLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationid=#{eamlocationid}
) t1
where eamlocationid=#{eamlocationid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMPLANLINE_EAMPLAN_EAMPLANID] -->
<select id="selectByEamplanid" resultMap="EAMPlanLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamplanid=#{eamplanid}
) t1
where eamplanid=#{eamplanid}
</select>
<!--数据集合[Default]-->
......
......@@ -22,8 +22,8 @@
<select id="selectByEamplanid" resultMap="EAMPlanScheduleResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamplanid=#{eamplanid}
) t1
where eamplanid=#{eamplanid}
</select>
<!--数据集合[Default]-->
......
......@@ -31,29 +31,29 @@
<select id="selectByAssetid" resultMap="EAMWorkOrderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where assetid=#{assetid}
) t1
where assetid=#{assetid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMLOCATION_EAMLOCATIONID] -->
<select id="selectByEamlocationid" resultMap="EAMWorkOrderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamlocationid=#{eamlocationid}
) t1
where eamlocationid=#{eamlocationid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMWORKORDER_PWORKORDERID] -->
<select id="selectByPworkorderid" resultMap="EAMWorkOrderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where pworkorderid=#{workorderid}
) t1
where pworkorderid=#{workorderid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMWOTYPE_EAMWOTYPEID] -->
<select id="selectByEamwotypeid" resultMap="EAMWorkOrderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamwotypeid=#{eamwotypeid}
) t1
where eamwotypeid=#{eamwotypeid}
</select>
<!--数据集合[Default]-->
......
......@@ -25,15 +25,15 @@
<select id="selectByEamwostatemodelid" resultMap="EAMWOStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamwostatemodelid=#{eamwostatemodelid}
) t1
where eamwostatemodelid=#{eamwostatemodelid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWOSTATEMODELLINE_EAMWOSTATE_EAMWOSTATEID] -->
<select id="selectByEamwostateid" resultMap="EAMWOStateModelLineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamwostateid=#{eamwostateid}
) t1
where eamwostateid=#{eamwostateid}
</select>
<!--数据集合[Default]-->
......
......@@ -22,8 +22,8 @@
<select id="selectByEamwostatemodelid" resultMap="EAMWOTypeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamwostatemodelid=#{eamwostatemodelid}
) t1
where eamwostatemodelid=#{eamwostatemodelid}
</select>
<!--数据集合[Default]-->
......
......@@ -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);
......@@ -9,6 +11,8 @@ public interface AuthTokenUtil {
Boolean validateToken(String token, UserDetails userDetails);
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册