|
@@ -1,5 +1,6 @@
|
|
|
package cn.efunbox.audio.controller;
|
|
|
|
|
|
+import cn.efunbox.audio.consts.Status;
|
|
|
import cn.efunbox.audio.entity.Channel;
|
|
|
import cn.efunbox.audio.service.ChannelService;
|
|
|
import cn.efunbox.audio.utils.ApiCode;
|
|
@@ -79,6 +80,8 @@ public class ChannelController {
|
|
|
HttpUtil.responseApiCode(request, response, ApiCode.RECORD_EXIST);
|
|
|
return;
|
|
|
}
|
|
|
+ channel.setHasSon(false);
|
|
|
+ channel.setStatus(Status.ONLINE.getCode());
|
|
|
channel.setCreated(new Timestamp(new Date().getTime()));
|
|
|
channel = channelService.Insert(channel);
|
|
|
if(channel.getIdFather()>0){
|
|
@@ -97,8 +100,14 @@ public class ChannelController {
|
|
|
HttpUtil.responseApiCode(request, response, ApiCode.PARAMETER_ERROR);
|
|
|
return;
|
|
|
}
|
|
|
+// System.out.println("ch:"+channel.toString());
|
|
|
+// System.out.println("chOld:"+channelOld.toString());
|
|
|
channel = (Channel) Common.CopyValue(channel, channelOld);
|
|
|
+// System.out.println("ch2:"+channel.toString());
|
|
|
+ if(channelOld.getHasSon())
|
|
|
+ channel.setHasSon(true);
|
|
|
channel = channelService.Insert(channel);
|
|
|
+// System.out.println("ch3:"+channel.toString());
|
|
|
HttpUtil.responseOkData(request, response, channel);
|
|
|
return;
|
|
|
}
|