|
@@ -86,7 +86,7 @@ public class UnitServiceImpl implements UnitService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean modificationUnit(UnitDto unitDto) {
|
|
|
+ public boolean modificationUnit(UnitDto unitDto,Integer userId) {
|
|
|
|
|
|
boolean flg = false;
|
|
|
// 处理主轴
|
|
@@ -97,6 +97,7 @@ public class UnitServiceImpl implements UnitService {
|
|
|
|
|
|
//更新
|
|
|
if (unitBearingsPO.getId() != null && unitBearingsPO.getId() > 0) {
|
|
|
+ unitBearingsPO.setUpdateBy(userId);
|
|
|
Example queryExample = new Example(UnitBearingsPO.class);
|
|
|
Example.Criteria criteria = queryExample.createCriteria();
|
|
|
criteria.andEqualTo("id", unitBearingsPO.getId());
|
|
@@ -107,8 +108,11 @@ public class UnitServiceImpl implements UnitService {
|
|
|
String unitBearingsCode = IdPrefixEnum.UNIT_BEARINGS_CODE.getCode().concat(IdGeneratorUtil.zeroFillUtil(cacheService.incr(ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_CONSTANTS_KEY, IdPrefixEnum.UNIT_BEARINGS_CODE.getCode()))));
|
|
|
unitBearingsPO.setMillTypeCode(unitDto.getMillTypeCode());
|
|
|
unitBearingsPO.setCode(unitBearingsCode);
|
|
|
+ unitBearingsPO.setCreateBy(userId);
|
|
|
+ unitBearingsPO.setUpdateBy(userId);
|
|
|
unitBearingsPO.setCreateTime(new Date());
|
|
|
unitBearingsPO.setUpdateTime(new Date());
|
|
|
+ unitBearingsPO.setDelState(DeleteStatusEnum.NODELETE.getCode());
|
|
|
flg = unitBearingsMapper.insertUseGeneratedKeys(unitBearingsPO) > 0;
|
|
|
}
|
|
|
|
|
@@ -120,6 +124,7 @@ public class UnitServiceImpl implements UnitService {
|
|
|
|
|
|
//更新
|
|
|
if (unitDynamoPO.getId() != null && unitDynamoPO.getId() > 0) {
|
|
|
+ unitDynamoPO.setUpdateBy(userId);
|
|
|
Example queryExample = new Example(UnitDynamoPO.class);
|
|
|
Example.Criteria criteria = queryExample.createCriteria();
|
|
|
criteria.andEqualTo("id", unitDynamoPO.getId());
|
|
@@ -127,11 +132,14 @@ public class UnitServiceImpl implements UnitService {
|
|
|
break outDynamo;
|
|
|
}
|
|
|
// 创建
|
|
|
- String unitDynamoCode = IdPrefixEnum.UNIT_GEAR_CODE.getCode().concat(IdGeneratorUtil.zeroFillUtil(cacheService.incr(ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_CONSTANTS_KEY, IdPrefixEnum.UNIT_DYNAMO_CODE.getCode()))));
|
|
|
+ String unitDynamoCode = IdPrefixEnum.UNIT_DYNAMO_CODE.getCode().concat(IdGeneratorUtil.zeroFillUtil(cacheService.incr(ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_CONSTANTS_KEY, IdPrefixEnum.UNIT_DYNAMO_CODE.getCode()))));
|
|
|
unitDynamoPO.setMillTypeCode(unitDto.getMillTypeCode());
|
|
|
unitDynamoPO.setCode(unitDynamoCode);
|
|
|
unitDynamoPO.setCreateTime(new Date());
|
|
|
unitDynamoPO.setUpdateTime(new Date());
|
|
|
+ unitDynamoPO.setCreateBy(userId);
|
|
|
+ unitDynamoPO.setUpdateBy(userId);
|
|
|
+ unitDynamoPO.setDelState(DeleteStatusEnum.NODELETE.getCode());
|
|
|
flg = unitDynamoMapper.insertUseGeneratedKeys(unitDynamoPO) > 0;
|
|
|
}
|
|
|
|
|
@@ -143,6 +151,7 @@ public class UnitServiceImpl implements UnitService {
|
|
|
unitGearboxPO.setLubricantBrand(unitDto.getUnitGearDto().getLubricantBrand());
|
|
|
unitGearboxPO.setLubricantModel(unitDto.getUnitGearDto().getLubricantModel());
|
|
|
unitGearboxPO.setUpdateTime(new Date());
|
|
|
+ unitGearboxPO.setUpdateBy(userId);
|
|
|
//更新齿轮箱总表
|
|
|
if (unitDto.getUnitGearDto().getId() != null && unitDto.getUnitGearDto().getId() > 0) {
|
|
|
unitGearboxPO.setId(unitDto.getUnitGearDto().getId());
|
|
@@ -156,6 +165,7 @@ public class UnitServiceImpl implements UnitService {
|
|
|
String unitGearboxCode = IdPrefixEnum.UNIT_GEAR_CODE.getCode().concat(IdGeneratorUtil.zeroFillUtil(cacheService.incr(ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_CONSTANTS_KEY, IdPrefixEnum.UNIT_GEAR_CODE.getCode()))));
|
|
|
unitGearboxPO.setCode(unitGearboxCode);
|
|
|
unitGearboxPO.setCreateTime(new Date());
|
|
|
+ unitGearboxPO.setCreateBy(userId);
|
|
|
unitGearboxPO.setDelState(DeleteStatusEnum.NODELETE.getCode());
|
|
|
flg = unitGearboxMapper.insertUseGeneratedKeys(unitGearboxPO) > 0;
|
|
|
|
|
@@ -170,6 +180,8 @@ public class UnitServiceImpl implements UnitService {
|
|
|
unitGearboxBearingsPO = new UnitGearboxBearingsPO();
|
|
|
BeanUtil.copyProperties(dto, unitGearboxBearingsPO);
|
|
|
unitGearboxBearingsPO.setGearboxCode(unitGearboxPO.getCode());
|
|
|
+ unitGearboxBearingsPO.setCreateBy(userId);
|
|
|
+ unitGearboxBearingsPO.setUpdateBy(userId);
|
|
|
unitGearboxBearingsPO.setCreateTime(new Date());
|
|
|
unitGearboxBearingsPO.setUpdateTime(new Date());
|
|
|
unitGearboxBearingsPOList.add(unitGearboxBearingsPO);
|
|
@@ -191,6 +203,8 @@ public class UnitServiceImpl implements UnitService {
|
|
|
unitGearboxStructurePO.setGearboxCode(unitGearboxPO.getCode());
|
|
|
unitGearboxStructurePO.setCreateTime(new Date());
|
|
|
unitGearboxStructurePO.setUpdateTime(new Date());
|
|
|
+ unitGearboxStructurePO.setCreateBy(userId);
|
|
|
+ unitGearboxStructurePO.setUpdateBy(userId);
|
|
|
unitGearboxStructurePOList.add(unitGearboxStructurePO);
|
|
|
}
|
|
|
UnitGearboxStructurePO po = new UnitGearboxStructurePO();
|