|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.xjrsoft.common.enums.SubscriptionTypeEnum;
|
|
import com.xjrsoft.common.enums.SubscriptionTypeEnum;
|
|
|
import com.xjrsoft.common.enums.TextbookTypeEnum;
|
|
import com.xjrsoft.common.enums.TextbookTypeEnum;
|
|
|
|
|
+import com.xjrsoft.common.enums.WarehouseModeEnum;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
@@ -246,28 +247,29 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
|
|
|
setTextbookId(textbook.getId());
|
|
setTextbookId(textbook.getId());
|
|
|
setWfTextbookSubscriptionId(wfTextbookSubscription.getId());
|
|
setWfTextbookSubscriptionId(wfTextbookSubscription.getId());
|
|
|
}});
|
|
}});
|
|
|
- }
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
|
|
- //征订的教材在教材管理,进行班级的和记录的管理
|
|
|
|
|
- Textbook textbook = textbookList.get(0);
|
|
|
|
|
|
|
+ //征订的教材在教材管理,进行班级的和记录的管理
|
|
|
|
|
+ Textbook textbook = textbookList.get(0);
|
|
|
|
|
|
|
|
- //班级不为空
|
|
|
|
|
- if (ObjectUtil.isNotNull(wfTextbookSubscriptionItem.getClassIds()) && !wfTextbookSubscriptionItem.getClassIds().equals("")) {
|
|
|
|
|
- //将班级ids转换为List
|
|
|
|
|
- String classIds = wfTextbookSubscriptionItem.getClassIds();
|
|
|
|
|
- String[] classIdStrs = classIds.split(",");
|
|
|
|
|
- for (String classIdStr : classIdStrs) {
|
|
|
|
|
- textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
|
|
|
|
|
- setTextbookId(textbook.getId());
|
|
|
|
|
- setClassId(Long.parseLong(classIdStr));
|
|
|
|
|
- }});
|
|
|
|
|
|
|
+ //班级不为空
|
|
|
|
|
+ if (ObjectUtil.isNotNull(wfTextbookSubscriptionItem.getClassIds()) && !wfTextbookSubscriptionItem.getClassIds().equals("")) {
|
|
|
|
|
+ //将班级ids转换为List
|
|
|
|
|
+ String classIds = wfTextbookSubscriptionItem.getClassIds();
|
|
|
|
|
+ String[] classIdStrs = classIds.split(",");
|
|
|
|
|
+ for (String classIdStr : classIdStrs) {
|
|
|
|
|
+ textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
|
|
|
|
|
+ setTextbookId(textbook.getId());
|
|
|
|
|
+ setClassId(Long.parseLong(classIdStr));
|
|
|
|
|
+ }});
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ //添加教材征订记录
|
|
|
|
|
+ textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
|
|
|
|
|
+ setTextbookId(textbook.getId());
|
|
|
|
|
+ setWfTextbookSubscriptionId(wfTextbookSubscription.getId());
|
|
|
|
|
+ }});
|
|
|
}
|
|
}
|
|
|
- //添加教材征订记录
|
|
|
|
|
- textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
|
|
|
|
|
- setTextbookId(textbook.getId());
|
|
|
|
|
- setWfTextbookSubscriptionId(wfTextbookSubscription.getId());
|
|
|
|
|
- }});
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
@@ -320,24 +322,24 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
|
|
|
setTextbookId(textbook.getId());
|
|
setTextbookId(textbook.getId());
|
|
|
setWfTextbookSubscriptionId(wfExerciseBook.getId());
|
|
setWfTextbookSubscriptionId(wfExerciseBook.getId());
|
|
|
}});
|
|
}});
|
|
|
- }
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //征订的教材在教材管理,进行班级的和记录的管理
|
|
|
|
|
+ Textbook textbook = textbookList.get(0);
|
|
|
|
|
|
|
|
- //征订的教材在教材管理,进行班级的和记录的管理
|
|
|
|
|
- Textbook textbook = textbookList.get(0);
|
|
|
|
|
|
|
+ //班级不为空
|
|
|
|
|
+ if (ObjectUtil.isNotNull(wfExerciseBook.getClassId()) && !wfExerciseBook.getClassId().equals("")) {
|
|
|
|
|
+ textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
|
|
|
|
|
+ setTextbookId(textbook.getId());
|
|
|
|
|
+ setClassId(wfExerciseBook.getClassId());
|
|
|
|
|
+ }});
|
|
|
|
|
|
|
|
- //班级不为空
|
|
|
|
|
- if (ObjectUtil.isNotNull(wfExerciseBook.getClassId()) && !wfExerciseBook.getClassId().equals("")) {
|
|
|
|
|
- textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ //添加教材征订记录
|
|
|
|
|
+ textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
|
|
|
setTextbookId(textbook.getId());
|
|
setTextbookId(textbook.getId());
|
|
|
- setClassId(wfExerciseBook.getClassId());
|
|
|
|
|
|
|
+ setWfTextbookSubscriptionId(wfExerciseBook.getId());
|
|
|
}});
|
|
}});
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
- //添加教材征订记录
|
|
|
|
|
- textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
|
|
|
|
|
- setTextbookId(textbook.getId());
|
|
|
|
|
- setWfTextbookSubscriptionId(wfExerciseBook.getId());
|
|
|
|
|
- }});
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
@@ -404,7 +406,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
|
|
|
@Override
|
|
@Override
|
|
|
public List<WfTextbookClaimListVo> claimList(Long id) {
|
|
public List<WfTextbookClaimListVo> claimList(Long id) {
|
|
|
List<WfTextbookClaimListVo> result = textbookTextbookMapper.claimList(id);
|
|
List<WfTextbookClaimListVo> result = textbookTextbookMapper.claimList(id);
|
|
|
- if(!result.isEmpty()){
|
|
|
|
|
|
|
+ if (!result.isEmpty()) {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
@@ -427,6 +429,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
|
|
|
boolean isSuccess = this.updateById(updateTextbook);
|
|
boolean isSuccess = this.updateById(updateTextbook);
|
|
|
|
|
|
|
|
TextbookWarehouseRecord textbookWarehouseRecord = BeanUtil.toBean(dto, TextbookWarehouseRecord.class);
|
|
TextbookWarehouseRecord textbookWarehouseRecord = BeanUtil.toBean(dto, TextbookWarehouseRecord.class);
|
|
|
|
|
+ textbookWarehouseRecord.setWarehouseMode(WarehouseModeEnum.WmManual.getCode());
|
|
|
isSuccess = textbookClassWarehouseService.save(textbookWarehouseRecord);
|
|
isSuccess = textbookClassWarehouseService.save(textbookWarehouseRecord);
|
|
|
|
|
|
|
|
return isSuccess;
|
|
return isSuccess;
|