提交 15e5eacf authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 e9a16282
......@@ -3,6 +3,7 @@ package com.zrqx.core.form.resource.bg.animation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.List;
import lombok.Data;
......@@ -18,7 +19,7 @@ public class BatchUpdateAnimationLibraryForm {
@ApiModelProperty("自定义分类code")
private List<String> diyTypeCode;
@ApiModelProperty("售价 ")
private String sellingPrice;
private BigDecimal sellingPrice;
@ApiModelProperty("价格状态 1:付费 2:免费")
private Integer priceType;
}
package com.zrqx.core.form.resource.bg.articlelibrary;
import java.math.BigDecimal;
import java.util.List;
import io.swagger.annotations.ApiModel;
......@@ -17,7 +18,7 @@ public class BatchUpdateArticleLibraryForm {
@ApiModelProperty("自定义分类code")
private List<String> diyTypeCode;
@ApiModelProperty("售价 ")
private String sellingPrice;
private BigDecimal sellingPrice;
@ApiModelProperty("价格状态 1:付费 2:免费")
private Integer priceType;
}
......@@ -39,6 +39,7 @@ import com.zrqx.core.model.resource.animationlibrary.AnimationLibrary;
import com.zrqx.core.model.resource.animationlibrary.AnimationLibraryDiyType;
import com.zrqx.core.model.resource.animationlibrary.AnimationLibraryLabel;
import com.zrqx.core.model.resource.animationlibrary.AnimationResource;
import com.zrqx.core.model.resource.ebook.BookGoods;
import com.zrqx.core.model.resource.imagelibrary.ImageLibraryLabel;
import com.zrqx.core.util.CallBack;
import com.zrqx.core.util.PageInfo;
......@@ -119,37 +120,29 @@ public class AnimationLibraryController {
if(form.getPriceType()==null || form.getPriceType().equals("")){
throw new BaseException("请选择售价类型");
}
Criteria cr = goodsService.createCriteria();
cr.andIn("objectId" , form.getIds());
List<AnimationGoods> list = goodsService.selectByCriteria();
if(list.size()>0){
for (AnimationGoods entity : list) {
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
for (String str : form.getIds()) {
AnimationGoods entity = new AnimationGoods();
if (form.getPriceType().equals(1)) {
entity.setSellingPrice(form.getSellingPrice());
} else {
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
if(!goodsService.updateByCriteria(entity)){
Criteria cr = goodsService.createCriteria();
cr.andEqualTo("objectId", str);
AnimationGoods bookGoods = goodsService.selectOneByCriteria();
if(bookGoods!=null){
if (!goodsService.updateByCriteria(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}else{
for (String str : form.getIds()) {
AnimationGoods entity = new AnimationGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
entity.setObjectId(str);
if(!goodsService.insert(entity)){
if (!goodsService.insert(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}
return CallBack.success();
}
@ApiOperation(value = "批量审核" , notes ="批量审核")
......
......@@ -32,6 +32,7 @@ import com.zrqx.core.form.resource.bg.SaverFileForm;
import com.zrqx.core.form.resource.bg.articlelibrary.BatchUpdateArticleLibraryForm;
import com.zrqx.core.form.resource.bg.articlelibrary.QueryArticleLibraryForm;
import com.zrqx.core.form.resource.bg.articlelibrary.SaveUpdateArticleLibraryForm;
import com.zrqx.core.model.resource.animationlibrary.AnimationGoods;
import com.zrqx.core.model.resource.articlelibrary.ArticleGoods;
import com.zrqx.core.model.resource.articlelibrary.ArticleLibrary;
import com.zrqx.core.model.resource.articlelibrary.ArticleLibraryDiyType;
......@@ -133,32 +134,25 @@ public class ArticleLibraryController {
if(form.getPriceType()==null || form.getPriceType().equals("")){
throw new BaseException("请选择售价类型");
}
Criteria cr = articleGoodsService.createCriteria();
cr.andIn("objectId", form.getIds());
List<ArticleGoods> list = articleGoodsService.selectByCriteria();
if(list.size()>0){
for (ArticleGoods entity : list) {
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
for (String str : form.getIds()) {
ArticleGoods entity = new ArticleGoods();
if (form.getPriceType().equals(1)) {
entity.setSellingPrice(form.getSellingPrice());
} else {
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
if(!articleGoodsService.updateByCriteria(entity)){
Criteria cr = articleGoodsService.createCriteria();
cr.andEqualTo("objectId", str);
ArticleGoods bookGoods = articleGoodsService.selectOneByCriteria();
if(bookGoods!=null){
if (!articleGoodsService.updateByCriteria(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}else{
for (String str : form.getIds()) {
ArticleGoods entity = new ArticleGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
entity.setObjectId(str);
if(!articleGoodsService.insert(entity)){
if (!articleGoodsService.insert(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
......
......@@ -119,30 +119,22 @@ public class AudioLibraryController {
if(form.getPriceType()==null || form.getPriceType().equals("")){
throw new BaseException("请选择售价类型");
}
Criteria cr = audioGoodsService.createCriteria();
cr.andIn("objectId", form.getIds());
List<AudioGoods> list = audioGoodsService.selectByCriteria();
if(list.size()>0){
for (AudioGoods entity : list) {
for (String str : form.getIds()) {
AudioGoods entity = new AudioGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
Criteria cr = audioGoodsService.createCriteria();
cr.andEqualTo("objectId", str);
AudioGoods list = audioGoodsService.selectOneByCriteria();
if(list!=null){
if (!audioGoodsService.updateByCriteria(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}else{
for (String str : form.getIds()) {
AudioGoods entity = new AudioGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
entity.setObjectId(str);
if (!audioGoodsService.insert(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
......
......@@ -118,39 +118,28 @@ public class CoursewareLibraryController {
if(form.getPriceType()==null || form.getPriceType().equals("")){
throw new BaseException("请选择售价类型");
}
Criteria cr = goodsService.createCriteria();
cr.andIn("objectId", form.getIds());
List<CoursewareGoods> list = goodsService.selectByCriteria();
if(list.size()>0){
for (CoursewareGoods entity : list) {
for (String str : form.getIds()) {
CoursewareGoods entity=new CoursewareGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
Criteria cr = goodsService.createCriteria();
cr.andEqualTo("objectId", str);
CoursewareGoods list = goodsService.selectOneByCriteria();
if(list!=null){
if (!goodsService.updateByCriteria(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}else{
List<String> objIds = form.getIds();
for (String str : objIds) {
CoursewareGoods entity=new CoursewareGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
entity.setObjectId(str);
if (!goodsService.insert(entity)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}
return CallBack.success();
}
......
......@@ -120,30 +120,22 @@ public class ImageLibraryController {
if(form.getPriceType()==null || form.getPriceType().equals("")){
throw new BaseException("请选择售价类型");
}
Criteria cr = goodsService.createCriteria();
cr.andIn("objectId" , form.getIds());
List<ImageGoods> list = goodsService.selectByCriteria();
if (list.size()>0) {
for (ImageGoods entity : list) {
for (String str : form.getIds()) {
ImageGoods entity = new ImageGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
Criteria cr = goodsService.createCriteria();
cr.andEqualTo("objectId" , str);
ImageGoods list = goodsService.selectOneByCriteria();
if(list!=null){
if(!goodsService.updateByCriteria(entity)){
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}else{
for (String str : form.getIds()) {
ImageGoods entity = new ImageGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
entity.setObjectId(str);
if(!goodsService.insert(entity)){
throw new BaseException(ResponseCodeEnum.FAIL);
......
......@@ -118,30 +118,22 @@ public class PdfLibraryController {
if(form.getPriceType()==null || form.getPriceType().equals("")){
throw new BaseException("请选择售价类型");
}
Criteria cr = goodsService.createCriteria();
cr.andIn("objectId", form.getIds());
List<PdfGoods> list = goodsService.selectByCriteria();
if(list.size()>0){
for (PdfGoods entity : list) {
for (String str : form.getIds()) {
PdfGoods entity=new PdfGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
Criteria cr = goodsService.createCriteria();
cr.andEqualTo("objectId",str);
PdfGoods list = goodsService.selectOneByCriteria();
if(list!=null){
if(!goodsService.updateByCriteria(entity)){
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}else{
for (String str : form.getIds()) {
PdfGoods entity=new PdfGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
entity.setObjectId(str);
if(!goodsService.insert(entity)){
throw new BaseException(ResponseCodeEnum.FAIL);
......
......@@ -121,37 +121,28 @@ public class VideoLibraryController {
if(form.getPriceType()==null || form.getPriceType().equals("")){
throw new BaseException("请选择售价类型");
}
Criteria cr = goodsService.createCriteria();
cr.andIn("objectId", form.getIds());
List<VideoGoods> list = goodsService.selectByCriteria();
if (list.size()>0) {
for (VideoGoods entity : list) {
for (String str : form.getIds()) {
VideoGoods entity=new VideoGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
Criteria cr = goodsService.createCriteria();
cr.andEqualTo("objectId", str);
VideoGoods list = goodsService.selectOneByCriteria();
if(list!=null){
if(!goodsService.updateByCriteria(entity)){
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
} else {
for (String str : form.getIds()) {
VideoGoods entity=new VideoGoods();
if(form.getPriceType().equals(1)){
entity.setSellingPrice(new BigDecimal(form.getSellingPrice()));
}else{
entity.setSellingPrice(null);
}
entity.setPriceType(form.getPriceType());
entity.setObjectId(str);
if(!goodsService.insert(entity)){
throw new BaseException(ResponseCodeEnum.FAIL);
}
}
}
return CallBack.success();
}
@ApiOperation(value = "批量审核" , notes ="批量审核")
......
......@@ -33,7 +33,7 @@ public interface EbookMapper extends BaseMapper<Ebook>{
*/
@Select("<script>"
+ "<if test='form.diyTypeCode == null'>"
+ "SELECT bb.id,bb.name,bb.cover,bb.subheading,bb.author,bb.isbn,bb.executiveEditor,bb.keywords,be.authorIntro,"
+ "SELECT DISTINCT bb.id,bb.name,bb.cover,bb.subheading,bb.author,bb.isbn,bb.executiveEditor,bb.keywords,be.authorIntro,"
+ " DATE_FORMAT(bb.uploadTime,'%Y-%m-%d %H:%i:%s') uploadTime,DATE_FORMAT(bb.publishTime,'%Y-%m-%d %H:%i:%s') publishTime,bb.updateTime,bb.status,"
+ " g.sellingPrice as sellingPrice,g.priceType,be.epubFile,be.bookIntro,bi.binding, "
+ " be.xmlFile,g.dataSources,bi.edition,bi.print,bb.resourceType FROM res_book bb "
......@@ -43,7 +43,7 @@ public interface EbookMapper extends BaseMapper<Ebook>{
+ " WHERE 1 = 1 and bb.isDelete=0 "
+ "</if>"
+ "<if test='form.diyTypeCode != null and form.diyTypeCode != \"\"'>"
+ "SELECT bb.id,bb.name,bb.cover,bb.subheading,bb.author,bb.isbn,bb.executiveEditor,bb.keywords,be.authorIntro,"
+ "SELECT DISTINCT bb.id,bb.name,bb.cover,bb.subheading,bb.author,bb.isbn,bb.executiveEditor,bb.keywords,be.authorIntro,"
+ " DATE_FORMAT(bb.uploadTime,'%Y-%m-%d %H:%i:%s') uploadTime,DATE_FORMAT(bb.publishTime,'%Y-%m-%d %H:%i:%s') publishTime,bb.updateTime,bb.status,"
+ " g.sellingPrice as sellingPrice,g.priceType,be.epubFile,be.bookIntro,bdt.code,bi.binding, "
+ " bdt.dtId,be.xmlFile,g.dataSources,bi.edition,bi.print,bb.resourceType FROM res_book bb "
......@@ -120,7 +120,7 @@ public interface EbookMapper extends BaseMapper<Ebook>{
List<EbookListVO> page(@Param("form") QueryEbookForm form);
@Select("<script>"
+ " <if test='form.diyTypeCode == null'>"
+ "SELECT bb.id,bb.cover,bb.name,bb.author,bb.isbn,bb.executiveEditor,"
+ "SELECT DISTINCT bb.id,bb.cover,bb.name,bb.author,bb.isbn,bb.executiveEditor,"
+ " DATE_FORMAT(bb.uploadTime,'%Y-%m-%d %H:%i:%s') uploadTime,bb.status,bb.resourceType as type"
+ " FROM res_book bb where 1=1 and bb.isDelete=0"
+ " </if>"
......@@ -143,7 +143,7 @@ public interface EbookMapper extends BaseMapper<Ebook>{
@Select("<script>"
+ "SELECT "
+ "bb.id,${form.names}"
+ "DISTINCT bb.id,${form.names}"
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.bookId "
+ " LEFT JOIN res_book_issued bi ON be.bookId = bi.objectId "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论