|
@@ -26,6 +26,7 @@ import com.kxs.user.api.model.KxsUserAmount;
|
|
|
import com.kxs.user.api.model.KxsUserReal;
|
|
import com.kxs.user.api.model.KxsUserReal;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -255,22 +256,16 @@ public class KxsWarehouseServiceImpl extends ServiceImpl<KxsWarehouseMapper, Kxs
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional
|
|
|
public void changeAccountData(DMLData dmlData) {
|
|
public void changeAccountData(DMLData dmlData) {
|
|
|
//修改的字段值
|
|
//修改的字段值
|
|
|
Map<String, Object> validFieldDataMap = dmlData.getValidFieldDataMap();
|
|
Map<String, Object> validFieldDataMap = dmlData.getValidFieldDataMap();
|
|
|
- //全部字段值
|
|
|
|
|
- Map<String, FieldData> fieldDataMap = dmlData.getFieldDataMap();
|
|
|
|
|
//修改的字段
|
|
//修改的字段
|
|
|
List<String> changeFieldList = dmlData.getChangeFieldList();
|
|
List<String> changeFieldList = dmlData.getChangeFieldList();
|
|
|
//操作的主键
|
|
//操作的主键
|
|
|
int id = Integer.parseInt(dmlData.getId());
|
|
int id = Integer.parseInt(dmlData.getId());
|
|
|
- Integer userId = null;
|
|
|
|
|
-
|
|
|
|
|
KxsWarehouseLimit warehouseLimit = new KxsWarehouseLimit();
|
|
KxsWarehouseLimit warehouseLimit = new KxsWarehouseLimit();
|
|
|
|
|
|
|
|
- if(fieldDataMap.get("UserId").getValue() != null){
|
|
|
|
|
- userId = Integer.valueOf(fieldDataMap.get("UserId").getValue().toString());
|
|
|
|
|
- }
|
|
|
|
|
for (String field : changeFieldList) {
|
|
for (String field : changeFieldList) {
|
|
|
|
|
|
|
|
switch (field) {
|
|
switch (field) {
|
|
@@ -297,12 +292,12 @@ public class KxsWarehouseServiceImpl extends ServiceImpl<KxsWarehouseMapper, Kxs
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (BeanUtil.isNotEmpty(warehouseLimit, "entityClass") && userId != null) {
|
|
|
|
|
|
|
+ if (BeanUtil.isNotEmpty(warehouseLimit, "entityClass")) {
|
|
|
KxsWarehouseLimit kxsWarehouseLimit = kxsWarehouseLimitMapper.selectOne(Wrappers.<KxsWarehouseLimit>lambdaQuery()
|
|
KxsWarehouseLimit kxsWarehouseLimit = kxsWarehouseLimitMapper.selectOne(Wrappers.<KxsWarehouseLimit>lambdaQuery()
|
|
|
.eq(KxsWarehouseLimit::getWarehouseType, 0)
|
|
.eq(KxsWarehouseLimit::getWarehouseType, 0)
|
|
|
- .eq(KxsWarehouseLimit::getUserId, userId));
|
|
|
|
|
|
|
+ .eq(KxsWarehouseLimit::getUserId, id));
|
|
|
if (kxsWarehouseLimit == null) {
|
|
if (kxsWarehouseLimit == null) {
|
|
|
- warehouseLimit.setUserId(userId);
|
|
|
|
|
|
|
+ warehouseLimit.setUserId(id);
|
|
|
kxsWarehouseLimitMapper.insert(warehouseLimit);
|
|
kxsWarehouseLimitMapper.insert(warehouseLimit);
|
|
|
}else{
|
|
}else{
|
|
|
warehouseLimit.setId(kxsWarehouseLimit.getId());
|
|
warehouseLimit.setId(kxsWarehouseLimit.getId());
|
|
@@ -312,22 +307,17 @@ public class KxsWarehouseServiceImpl extends ServiceImpl<KxsWarehouseMapper, Kxs
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional
|
|
|
public void changeAccountMinData(DMLData dmlData) {
|
|
public void changeAccountMinData(DMLData dmlData) {
|
|
|
//修改的字段值
|
|
//修改的字段值
|
|
|
Map<String, Object> validFieldDataMap = dmlData.getValidFieldDataMap();
|
|
Map<String, Object> validFieldDataMap = dmlData.getValidFieldDataMap();
|
|
|
- //全部字段值
|
|
|
|
|
- Map<String, FieldData> fieldDataMap = dmlData.getFieldDataMap();
|
|
|
|
|
//修改的字段
|
|
//修改的字段
|
|
|
List<String> changeFieldList = dmlData.getChangeFieldList();
|
|
List<String> changeFieldList = dmlData.getChangeFieldList();
|
|
|
//操作的主键
|
|
//操作的主键
|
|
|
int id = Integer.parseInt(dmlData.getId());
|
|
int id = Integer.parseInt(dmlData.getId());
|
|
|
- Integer userId = null;
|
|
|
|
|
|
|
|
|
|
KxsWarehouseLimit warehouseLimit = new KxsWarehouseLimit();
|
|
KxsWarehouseLimit warehouseLimit = new KxsWarehouseLimit();
|
|
|
|
|
|
|
|
- if(fieldDataMap.get("UserId").getValue() != null){
|
|
|
|
|
- userId = Integer.valueOf(fieldDataMap.get("UserId").getValue().toString());
|
|
|
|
|
- }
|
|
|
|
|
for (String field : changeFieldList) {
|
|
for (String field : changeFieldList) {
|
|
|
|
|
|
|
|
switch (field) {
|
|
switch (field) {
|
|
@@ -354,12 +344,14 @@ public class KxsWarehouseServiceImpl extends ServiceImpl<KxsWarehouseMapper, Kxs
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (BeanUtil.isNotEmpty(warehouseLimit, "entityClass") && userId != null) {
|
|
|
|
|
|
|
+ if (BeanUtil.isNotEmpty(warehouseLimit, "entityClass")) {
|
|
|
KxsWarehouseLimit kxsWarehouseLimit = kxsWarehouseLimitMapper.selectOne(Wrappers.<KxsWarehouseLimit>lambdaQuery()
|
|
KxsWarehouseLimit kxsWarehouseLimit = kxsWarehouseLimitMapper.selectOne(Wrappers.<KxsWarehouseLimit>lambdaQuery()
|
|
|
.eq(KxsWarehouseLimit::getWarehouseType, 1)
|
|
.eq(KxsWarehouseLimit::getWarehouseType, 1)
|
|
|
- .eq(KxsWarehouseLimit::getUserId, userId));
|
|
|
|
|
|
|
+ .eq(KxsWarehouseLimit::getUserId, id));
|
|
|
if (kxsWarehouseLimit == null) {
|
|
if (kxsWarehouseLimit == null) {
|
|
|
- warehouseLimit.setUserId(userId);
|
|
|
|
|
|
|
+ warehouseLimit.setUserId(id);
|
|
|
|
|
+ //小分仓
|
|
|
|
|
+ warehouseLimit.setWarehouseType(1);
|
|
|
kxsWarehouseLimitMapper.insert(warehouseLimit);
|
|
kxsWarehouseLimitMapper.insert(warehouseLimit);
|
|
|
}else{
|
|
}else{
|
|
|
warehouseLimit.setId(kxsWarehouseLimit.getId());
|
|
warehouseLimit.setId(kxsWarehouseLimit.getId());
|