6 changed files with 914 additions and 10 deletions
-
296xm-core/src/main/java/com/xm/core/ctrl/XmTaskOrderController.java
-
48xm-core/src/main/java/com/xm/core/entity/XmTask.java
-
168xm-core/src/main/java/com/xm/core/entity/XmTaskOrder.java
-
24xm-core/src/main/java/com/xm/core/service/XmTaskOrderService.java
-
56xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml
-
332xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskOrderMapper.xml
@ -0,0 +1,296 @@ |
|||
package com.xm.core.ctrl; |
|||
|
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.util.StringUtils; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import io.swagger.annotations.*; |
|||
|
|||
import static com.mdp.core.utils.ResponseHelper.*; |
|||
import static com.mdp.core.utils.BaseUtils.*; |
|||
import com.mdp.core.entity.Tips; |
|||
import com.mdp.core.err.BizException; |
|||
import com.mdp.mybatis.PageUtils; |
|||
import com.mdp.core.utils.RequestUtils; |
|||
import com.mdp.core.utils.NumberUtil; |
|||
import com.mdp.safe.client.entity.User; |
|||
import com.mdp.safe.client.utils.LoginUtils; |
|||
import com.mdp.swagger.ApiEntityParams; |
|||
import springfox.documentation.annotations.ApiIgnore; |
|||
|
|||
import com.xm.core.service.XmTaskOrderService; |
|||
import com.xm.core.entity.XmTaskOrder; |
|||
|
|||
/** |
|||
* url编制采用rest风格,如对xm_task_order 任务相关费用订单表的操作有增删改查,对应的url分别为:<br> |
|||
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> |
|||
* 实体 XmTaskOrder 表 xm_task_order 当前主键(包括多主键): id; |
|||
***/ |
|||
@RestController("xm.core.xmTaskOrderController") |
|||
@RequestMapping(value="/**/core/xmTaskOrder") |
|||
@Api(tags={"任务相关费用订单表操作接口"}) |
|||
public class XmTaskOrderController { |
|||
|
|||
static Logger logger =LoggerFactory.getLogger(XmTaskOrderController.class); |
|||
|
|||
@Autowired |
|||
private XmTaskOrderService xmTaskOrderService; |
|||
|
|||
|
|||
Map<String,Object> fieldsMap = toMap(new XmTaskOrder()); |
|||
|
|||
|
|||
@ApiOperation( value = "查询任务相关费用订单表信息列表",notes=" ") |
|||
@ApiEntityParams( XmTaskOrder.class ) |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name="pageSize",value="每页大小,默认20条",required=false), |
|||
@ApiImplicitParam(name="pageNum",value="当前页码,从1开始",required=false), |
|||
@ApiImplicitParam(name="total",value="总记录数,服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算",required=false), |
|||
@ApiImplicitParam(name="count",value="是否计算总记录条数,如果count=true,则计算计算总条数,如果count=false 则不计算",required=false), |
|||
@ApiImplicitParam(name="orderBy",value="排序列 如性别、学生编号排序 orderBy = sex desc,student desc",required=false), |
|||
}) |
|||
@ApiResponses({ |
|||
@ApiResponse(code = 200,response=XmTaskOrder.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") |
|||
}) |
|||
@RequestMapping(value="/list",method=RequestMethod.GET) |
|||
public Map<String,Object> listXmTaskOrder( @ApiIgnore @RequestParam Map<String,Object> xmTaskOrder){ |
|||
Map<String,Object> m = new HashMap<>(); |
|||
Tips tips=new Tips("查询成功"); |
|||
RequestUtils.transformArray(xmTaskOrder, "ids"); |
|||
PageUtils.startPage(xmTaskOrder); |
|||
List<Map<String,Object>> xmTaskOrderList = xmTaskOrderService.selectListMapByWhere(xmTaskOrder); //列出XmTaskOrder列表 |
|||
PageUtils.responePage(m, xmTaskOrderList); |
|||
m.put("data",xmTaskOrderList); |
|||
|
|||
m.put("tips", tips); |
|||
return m; |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
@ApiOperation( value = "新增一条任务相关费用订单表信息",notes=" ") |
|||
@ApiResponses({ |
|||
@ApiResponse(code = 200,response=XmTaskOrder.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") |
|||
}) |
|||
@RequestMapping(value="/add",method=RequestMethod.POST) |
|||
public Map<String,Object> addXmTaskOrder(@RequestBody XmTaskOrder xmTaskOrder) { |
|||
Map<String,Object> m = new HashMap<>(); |
|||
Tips tips=new Tips("成功新增一条数据"); |
|||
try{ |
|||
boolean createPk=false; |
|||
if(!StringUtils.hasText(xmTaskOrder.getId())) { |
|||
createPk=true; |
|||
xmTaskOrder.setId(xmTaskOrderService.createKey("id")); |
|||
} |
|||
if(createPk==false){ |
|||
if(xmTaskOrderService.selectOneObject(xmTaskOrder) !=null ){ |
|||
return failed("pk-exists","编号重复,请修改编号再提交"); |
|||
} |
|||
} |
|||
xmTaskOrderService.insert(xmTaskOrder); |
|||
m.put("data",xmTaskOrder); |
|||
}catch (BizException e) { |
|||
tips=e.getTips(); |
|||
logger.error("",e); |
|||
}catch (Exception e) { |
|||
tips.setFailureMsg(e.getMessage()); |
|||
logger.error("",e); |
|||
} |
|||
m.put("tips", tips); |
|||
return m; |
|||
} |
|||
*/ |
|||
|
|||
/** |
|||
@ApiOperation( value = "删除一条任务相关费用订单表信息",notes=" ") |
|||
@ApiResponses({ |
|||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") |
|||
}) |
|||
@RequestMapping(value="/del",method=RequestMethod.POST) |
|||
public Map<String,Object> delXmTaskOrder(@RequestBody XmTaskOrder xmTaskOrder){ |
|||
Map<String,Object> m = new HashMap<>(); |
|||
Tips tips=new Tips("成功删除一条数据"); |
|||
try{ |
|||
if(!StringUtils.hasText(xmTaskOrder.getId())) { |
|||
return failed("pk-not-exists","请上送主键参数id"); |
|||
} |
|||
XmTaskOrder xmTaskOrderDb = xmTaskOrderService.selectOneObject(xmTaskOrder); |
|||
if( xmTaskOrderDb == null ){ |
|||
return failed("data-not-exists","数据不存在,无法删除"); |
|||
} |
|||
xmTaskOrderService.deleteByPk(xmTaskOrder); |
|||
}catch (BizException e) { |
|||
tips=e.getTips(); |
|||
logger.error("",e); |
|||
}catch (Exception e) { |
|||
tips.setFailureMsg(e.getMessage()); |
|||
logger.error("",e); |
|||
} |
|||
m.put("tips", tips); |
|||
return m; |
|||
} |
|||
*/ |
|||
|
|||
/** |
|||
@ApiOperation( value = "根据主键修改一条任务相关费用订单表信息",notes=" ") |
|||
@ApiResponses({ |
|||
@ApiResponse(code = 200,response=XmTaskOrder.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") |
|||
}) |
|||
@RequestMapping(value="/edit",method=RequestMethod.POST) |
|||
public Map<String,Object> editXmTaskOrder(@RequestBody XmTaskOrder xmTaskOrder) { |
|||
Map<String,Object> m = new HashMap<>(); |
|||
Tips tips=new Tips("成功更新一条数据"); |
|||
try{ |
|||
if(!StringUtils.hasText(xmTaskOrder.getId())) { |
|||
return failed("pk-not-exists","请上送主键参数id"); |
|||
} |
|||
XmTaskOrder xmTaskOrderDb = xmTaskOrderService.selectOneObject(xmTaskOrder); |
|||
if( xmTaskOrderDb == null ){ |
|||
return failed("data-not-exists","数据不存在,无法修改"); |
|||
} |
|||
xmTaskOrderService.updateSomeFieldByPk(xmTaskOrder); |
|||
m.put("data",xmTaskOrder); |
|||
}catch (BizException e) { |
|||
tips=e.getTips(); |
|||
logger.error("",e); |
|||
}catch (Exception e) { |
|||
tips.setFailureMsg(e.getMessage()); |
|||
logger.error("",e); |
|||
} |
|||
m.put("tips", tips); |
|||
return m; |
|||
} |
|||
*/ |
|||
|
|||
/** |
|||
@ApiOperation( value = "批量修改某些字段",notes="") |
|||
@ApiEntityParams( value = XmTaskOrder.class, props={ }, remark = "任务相关费用订单表", paramType = "body" ) |
|||
@ApiResponses({ |
|||
@ApiResponse(code = 200,response=XmTaskOrder.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") |
|||
}) |
|||
@RequestMapping(value="/editSomeFields",method=RequestMethod.POST) |
|||
public Map<String,Object> editSomeFields( @ApiIgnore @RequestBody Map<String,Object> xmTaskOrderMap) { |
|||
Map<String,Object> m = new HashMap<>(); |
|||
Tips tips=new Tips("成功更新一条数据"); |
|||
try{ |
|||
List<String> ids= (List<String>) xmTaskOrderMap.get("ids"); |
|||
if(ids==null || ids.size()==0){ |
|||
return failed("ids-0","ids不能为空"); |
|||
} |
|||
|
|||
Set<String> fields=new HashSet<>(); |
|||
fields.add("id"); |
|||
for (String fieldName : xmTaskOrderMap.keySet()) { |
|||
if(fields.contains(fieldName)){ |
|||
return failed(fieldName+"-no-edit",fieldName+"不允许修改"); |
|||
} |
|||
} |
|||
Set<String> fieldKey=xmTaskOrderMap.keySet().stream().filter(i-> fieldsMap.containsKey(i)).collect(Collectors.toSet()); |
|||
fieldKey=fieldKey.stream().filter(i->!StringUtils.isEmpty(xmTaskOrderMap.get(i) )).collect(Collectors.toSet()); |
|||
|
|||
if(fieldKey.size()<=0) { |
|||
return failed("fieldKey-0","没有需要更新的字段"); |
|||
} |
|||
XmTaskOrder xmTaskOrder = fromMap(xmTaskOrderMap,XmTaskOrder.class); |
|||
List<XmTaskOrder> xmTaskOrdersDb=xmTaskOrderService.selectListByIds(ids); |
|||
if(xmTaskOrdersDb==null ||xmTaskOrdersDb.size()==0){ |
|||
return failed("data-0","记录已不存在"); |
|||
} |
|||
List<XmTaskOrder> can=new ArrayList<>(); |
|||
List<XmTaskOrder> no=new ArrayList<>(); |
|||
User user = LoginUtils.getCurrentUserInfo(); |
|||
for (XmTaskOrder xmTaskOrderDb : xmTaskOrdersDb) { |
|||
Tips tips2 = new Tips("检查通过"); |
|||
if(!tips2.isOk()){ |
|||
no.add(xmTaskOrderDb); |
|||
}else{ |
|||
can.add(xmTaskOrderDb); |
|||
} |
|||
} |
|||
if(can.size()>0){ |
|||
xmTaskOrderMap.put("ids",can.stream().map(i->i.getId()).collect(Collectors.toList())); |
|||
xmTaskOrderService.editSomeFields(xmTaskOrderMap); |
|||
} |
|||
List<String> msgs=new ArrayList<>(); |
|||
if(can.size()>0){ |
|||
msgs.add(String.format("成功更新以下%s条数据",can.size())); |
|||
} |
|||
if(no.size()>0){ |
|||
msgs.add(String.format("以下%s个数据无权限更新",no.size())); |
|||
} |
|||
if(can.size()>0){ |
|||
tips.setOkMsg(msgs.stream().collect(Collectors.joining())); |
|||
}else { |
|||
tips.setFailureMsg(msgs.stream().collect(Collectors.joining())); |
|||
} |
|||
//m.put("data",xmMenu); |
|||
}catch (BizException e) { |
|||
tips=e.getTips(); |
|||
logger.error("",e); |
|||
}catch (Exception e) { |
|||
tips.setFailureMsg(e.getMessage()); |
|||
logger.error("",e); |
|||
} |
|||
m.put("tips", tips); |
|||
return m; |
|||
} |
|||
*/ |
|||
|
|||
/** |
|||
@ApiOperation( value = "根据主键列表批量删除任务相关费用订单表信息",notes=" ") |
|||
@ApiResponses({ |
|||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") |
|||
}) |
|||
@RequestMapping(value="/batchDel",method=RequestMethod.POST) |
|||
public Map<String,Object> batchDelXmTaskOrder(@RequestBody List<XmTaskOrder> xmTaskOrders) { |
|||
Map<String,Object> m = new HashMap<>(); |
|||
Tips tips=new Tips("成功删除"); |
|||
try{ |
|||
if(xmTaskOrders.size()<=0){ |
|||
return failed("data-0","请上送待删除数据列表"); |
|||
} |
|||
List<XmTaskOrder> datasDb=xmTaskOrderService.selectListByIds(xmTaskOrders.stream().map(i-> i.getId() ).collect(Collectors.toList())); |
|||
|
|||
List<XmTaskOrder> can=new ArrayList<>(); |
|||
List<XmTaskOrder> no=new ArrayList<>(); |
|||
for (XmTaskOrder data : datasDb) { |
|||
if(true){ |
|||
can.add(data); |
|||
}else{ |
|||
no.add(data); |
|||
} |
|||
} |
|||
List<String> msgs=new ArrayList<>(); |
|||
if(can.size()>0){ |
|||
xmTaskOrderService.batchDelete(can); |
|||
msgs.add(String.format("成功删除%s条数据.",can.size())); |
|||
} |
|||
|
|||
if(no.size()>0){ |
|||
msgs.add(String.format("以下%s条数据不能删除.【%s】",no.size(),no.stream().map(i-> i.getId() ).collect(Collectors.joining(",")))); |
|||
} |
|||
if(can.size()>0){ |
|||
tips.setOkMsg(msgs.stream().collect(Collectors.joining())); |
|||
}else { |
|||
tips.setFailureMsg(msgs.stream().collect(Collectors.joining())); |
|||
} |
|||
}catch (BizException e) { |
|||
tips=e.getTips(); |
|||
logger.error("",e); |
|||
}catch (Exception e) { |
|||
tips.setFailureMsg(e.getMessage()); |
|||
logger.error("",e); |
|||
} |
|||
m.put("tips", tips); |
|||
return m; |
|||
} |
|||
*/ |
|||
} |
|||
@ -0,0 +1,168 @@ |
|||
package com.xm.core.entity; |
|||
|
|||
import lombok.Data; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import java.util.Date; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> |
|||
* 实体 XmTaskOrder所有属性名: <br> |
|||
* "userid","用户编号","branchId","公司ID-下单客户对应的企业","ostatus","订单状态0-初始,1-待确认,2-待付款,3-已付款,4-已完成,5-已取消-未付款前可取消,取消后可删除,6-退单-退单后变为已取消,8已关闭-售后完成后可以关闭订单","ctime","创建时间","ltime","更新时间","payType","支付方式","payStatus","支付状态0待付款,1已付款","payTime","支付时间","prepayId","第三方支付订单编号","id","订单编号","finalFee","最终总费用=origin_fee","othFee","其它费用","originFee","原始价格=top_fee+urgent_fee+crm_sup_fee+hot_fee+efunds","payAt","最终付款金额-客户付款后回填","payAuthId","支付授权码","payOpenid","支付账户对应的第三方openid,注意,下单根付款不一定是同一个人","payUserid","付款用户编号","payUsername","付款用户名称","discount","折扣率0-199","topFee","置顶费用","topStime","置顶开始时间","topEtime","置顶结束时间","hotFee","热搜费用","hotStime","热搜开始时间","hotEtime","热搜结束时间","top","是否置顶","hot","是否热搜","crmSupFee","客服包办费用","urgentFee","加急费用","urgent","是否加急","crmSup","是否客服包办","efunds","托管金额","estate","资金托管状况0-无须托管,1-已托管,2-已付款给服务商,3-已退款","etoPlatTime","托管资金付款给平台的时间","etoDevTime","托管资金支付给服务商的时间","ebackTime","托管资金退回甲方时间","taskId","任务编号","topDays","置顶天数","hotDays","热搜天数","urgentDays","加急天数","urgentStime","加急开始时间","urgentEtime","加急结束时间","calcStatus","定时检查日期是否已过期,已过期则取消任务中的置顶、加急、热搜状态计算状态0-无须计算,1-本周期已计算待下周期计算,2-结束","calcTime","计算时间";<br> |
|||
* 当前主键(包括多主键):<br> |
|||
* id;<br> |
|||
*/ |
|||
@Data |
|||
@ApiModel(description="任务相关费用订单表") |
|||
public class XmTaskOrder implements java.io.Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty(notes="订单编号,主键",allowEmptyValue=true,example="",allowableValues="") |
|||
String id; |
|||
|
|||
|
|||
@ApiModelProperty(notes="用户编号",allowEmptyValue=true,example="",allowableValues="") |
|||
String userid; |
|||
|
|||
@ApiModelProperty(notes="公司ID-下单客户对应的企业",allowEmptyValue=true,example="",allowableValues="") |
|||
String branchId; |
|||
|
|||
@ApiModelProperty(notes="订单状态0-初始,1-待确认,2-待付款,3-已付款,4-已完成,5-已取消-未付款前可取消,取消后可删除,6-退单-退单后变为已取消,8已关闭-售后完成后可以关闭订单",allowEmptyValue=true,example="",allowableValues="") |
|||
String ostatus; |
|||
|
|||
@ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date ctime; |
|||
|
|||
@ApiModelProperty(notes="更新时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date ltime; |
|||
|
|||
@ApiModelProperty(notes="支付方式",allowEmptyValue=true,example="",allowableValues="") |
|||
String payType; |
|||
|
|||
@ApiModelProperty(notes="支付状态0待付款,1已付款",allowEmptyValue=true,example="",allowableValues="") |
|||
String payStatus; |
|||
|
|||
@ApiModelProperty(notes="支付时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date payTime; |
|||
|
|||
@ApiModelProperty(notes="第三方支付订单编号",allowEmptyValue=true,example="",allowableValues="") |
|||
String prepayId; |
|||
|
|||
@ApiModelProperty(notes="最终总费用=origin_fee",allowEmptyValue=true,example="",allowableValues="") |
|||
BigDecimal finalFee; |
|||
|
|||
@ApiModelProperty(notes="其它费用",allowEmptyValue=true,example="",allowableValues="") |
|||
BigDecimal othFee; |
|||
|
|||
@ApiModelProperty(notes="原始价格=top_fee+urgent_fee+crm_sup_fee+hot_fee+efunds",allowEmptyValue=true,example="",allowableValues="") |
|||
BigDecimal originFee; |
|||
|
|||
@ApiModelProperty(notes="最终付款金额-客户付款后回填",allowEmptyValue=true,example="",allowableValues="") |
|||
BigDecimal payAt; |
|||
|
|||
@ApiModelProperty(notes="支付授权码",allowEmptyValue=true,example="",allowableValues="") |
|||
String payAuthId; |
|||
|
|||
@ApiModelProperty(notes="支付账户对应的第三方openid,注意,下单根付款不一定是同一个人",allowEmptyValue=true,example="",allowableValues="") |
|||
String payOpenid; |
|||
|
|||
@ApiModelProperty(notes="付款用户编号",allowEmptyValue=true,example="",allowableValues="") |
|||
String payUserid; |
|||
|
|||
@ApiModelProperty(notes="付款用户名称",allowEmptyValue=true,example="",allowableValues="") |
|||
String payUsername; |
|||
|
|||
@ApiModelProperty(notes="折扣率0-199",allowEmptyValue=true,example="",allowableValues="") |
|||
Integer discount; |
|||
|
|||
@ApiModelProperty(notes="置顶费用",allowEmptyValue=true,example="",allowableValues="") |
|||
BigDecimal topFee; |
|||
|
|||
@ApiModelProperty(notes="置顶开始时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date topStime; |
|||
|
|||
@ApiModelProperty(notes="置顶结束时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date topEtime; |
|||
|
|||
@ApiModelProperty(notes="热搜费用",allowEmptyValue=true,example="",allowableValues="") |
|||
String hotFee; |
|||
|
|||
@ApiModelProperty(notes="热搜开始时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date hotStime; |
|||
|
|||
@ApiModelProperty(notes="热搜结束时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date hotEtime; |
|||
|
|||
@ApiModelProperty(notes="是否置顶",allowEmptyValue=true,example="",allowableValues="") |
|||
String top; |
|||
|
|||
@ApiModelProperty(notes="是否热搜",allowEmptyValue=true,example="",allowableValues="") |
|||
String hot; |
|||
|
|||
@ApiModelProperty(notes="客服包办费用",allowEmptyValue=true,example="",allowableValues="") |
|||
String crmSupFee; |
|||
|
|||
@ApiModelProperty(notes="加急费用",allowEmptyValue=true,example="",allowableValues="") |
|||
BigDecimal urgentFee; |
|||
|
|||
@ApiModelProperty(notes="是否加急",allowEmptyValue=true,example="",allowableValues="") |
|||
String urgent; |
|||
|
|||
@ApiModelProperty(notes="是否客服包办",allowEmptyValue=true,example="",allowableValues="") |
|||
String crmSup; |
|||
|
|||
@ApiModelProperty(notes="托管金额",allowEmptyValue=true,example="",allowableValues="") |
|||
BigDecimal efunds; |
|||
|
|||
@ApiModelProperty(notes="资金托管状况0-无须托管,1-已托管,2-已付款给服务商,3-已退款",allowEmptyValue=true,example="",allowableValues="") |
|||
String estate; |
|||
|
|||
@ApiModelProperty(notes="托管资金付款给平台的时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date etoPlatTime; |
|||
|
|||
@ApiModelProperty(notes="托管资金支付给服务商的时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date etoDevTime; |
|||
|
|||
@ApiModelProperty(notes="托管资金退回甲方时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date ebackTime; |
|||
|
|||
@ApiModelProperty(notes="任务编号",allowEmptyValue=true,example="",allowableValues="") |
|||
String taskId; |
|||
|
|||
@ApiModelProperty(notes="置顶天数",allowEmptyValue=true,example="",allowableValues="") |
|||
Integer topDays; |
|||
|
|||
@ApiModelProperty(notes="热搜天数",allowEmptyValue=true,example="",allowableValues="") |
|||
Integer hotDays; |
|||
|
|||
@ApiModelProperty(notes="加急天数",allowEmptyValue=true,example="",allowableValues="") |
|||
Integer urgentDays; |
|||
|
|||
@ApiModelProperty(notes="加急开始时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date urgentStime; |
|||
|
|||
@ApiModelProperty(notes="加急结束时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date urgentEtime; |
|||
|
|||
@ApiModelProperty(notes="定时检查日期是否已过期,已过期则取消任务中的置顶、加急、热搜状态计算状态0-无须计算,1-本周期已计算待下周期计算,2-结束",allowEmptyValue=true,example="",allowableValues="") |
|||
String calcStatus; |
|||
|
|||
@ApiModelProperty(notes="计算时间",allowEmptyValue=true,example="",allowableValues="") |
|||
Date calcTime; |
|||
|
|||
/** |
|||
*订单编号 |
|||
**/ |
|||
public XmTaskOrder(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
/** |
|||
* 任务相关费用订单表 |
|||
**/ |
|||
public XmTaskOrder() { |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.xm.core.service; |
|||
|
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import org.springframework.stereotype.Service; |
|||
import com.mdp.core.service.BaseService; |
|||
import static com.mdp.core.utils.BaseUtils.*; |
|||
import com.mdp.core.entity.Tips; |
|||
import com.mdp.core.err.BizException; |
|||
|
|||
import com.xm.core.entity.XmTaskOrder; |
|||
/** |
|||
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> |
|||
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> |
|||
* 实体 XmTaskOrder 表 xm_task_order 当前主键(包括多主键): id; |
|||
***/ |
|||
@Service("xm.core.xmTaskOrderService") |
|||
public class XmTaskOrderService extends BaseService { |
|||
static Logger logger =LoggerFactory.getLogger(XmTaskOrderService.class); |
|||
|
|||
} |
|||
|
|||
@ -0,0 +1,332 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.xm.core.entity.XmTaskOrder"> |
|||
|
|||
|
|||
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|||
|
|||
<sql id="whereForMap"> |
|||
<if test=" ids != null"> and (res.id) in |
|||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|||
( #{item}) |
|||
</foreach> |
|||
</if> |
|||
<if test="key != null and key !='' "> </if> |
|||
</sql> |
|||
|
|||
|
|||
<!--结束 自定义sql函数区域--> |
|||
|
|||
|
|||
|
|||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|||
select * from xm_task_order res |
|||
<where> |
|||
<include refid="whereForMap"/> |
|||
<include refid="where"/> |
|||
</where> |
|||
</select> |
|||
|
|||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|||
<select id="selectListByWhere" parameterType="com.xm.core.entity.XmTaskOrder" resultType="com.xm.core.entity.XmTaskOrder"> |
|||
select * from xm_task_order res |
|||
<where> |
|||
<include refid="where"/> |
|||
</where> |
|||
</select> |
|||
|
|||
<!-- 通过主键查询获取数据对象 返回object --> |
|||
<select id="selectOneObject" parameterType="com.xm.core.entity.XmTaskOrder" resultType="com.xm.core.entity.XmTaskOrder"> |
|||
select * from xm_task_order res |
|||
where |
|||
res.id = #{id} |
|||
</select> |
|||
<select id="selectListByIds" parameterType="List" resultType="com.xm.core.entity.XmTaskOrder"> |
|||
select * from xm_task_order res |
|||
where (res.id) in |
|||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|||
( #{item}) |
|||
</foreach> |
|||
</select> |
|||
<!-- 通过主键查询获取数据对象 返回map--> |
|||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|||
select * from xm_task_order res |
|||
where |
|||
res.id = #{id} |
|||
</select> |
|||
<!-- 获取数据条目 返回long --> |
|||
<select id="countByWhere" parameterType="com.xm.core.entity.XmTaskOrder" resultType="long"> |
|||
select count(*) from xm_task_order res |
|||
<where> |
|||
<include refid="where"/> |
|||
</where> |
|||
</select> |
|||
<!-- 新增一条记录 主键id,--> |
|||
<insert id="insert" parameterType="com.xm.core.entity.XmTaskOrder" useGeneratedKeys="false" keyProperty="id"> |
|||
insert into xm_task_order( |
|||
<include refid="columns"/> |
|||
) values ( |
|||
#{userid},#{branchId},#{ostatus},#{ctime},#{ltime},#{payType},#{payStatus},#{payTime},#{prepayId},#{id},#{finalFee},#{othFee},#{originFee},#{payAt},#{payAuthId},#{payOpenid},#{payUserid},#{payUsername},#{discount},#{topFee},#{topStime},#{topEtime},#{hotFee},#{hotStime},#{hotEtime},#{top},#{hot},#{crmSupFee},#{urgentFee},#{urgent},#{crmSup},#{efunds},#{estate},#{etoPlatTime},#{etoDevTime},#{ebackTime},#{taskId},#{topDays},#{hotDays},#{urgentDays},#{urgentStime},#{urgentEtime},#{calcStatus},#{calcTime} |
|||
) |
|||
</insert> |
|||
|
|||
<!-- 按条件删除若干条记录--> |
|||
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmTaskOrder"> |
|||
delete from xm_task_order res |
|||
<where> |
|||
<include refid="where"/> |
|||
</where> |
|||
</delete> |
|||
|
|||
<!-- 按主键删除一条记录--> |
|||
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmTaskOrder"> |
|||
delete from xm_task_order |
|||
where id = #{id} |
|||
</delete> |
|||
|
|||
<!-- 根据条件修改若干条记录 --> |
|||
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmTaskOrder"> |
|||
update xm_task_order |
|||
<set> |
|||
<include refid="someFieldSet"/> |
|||
</set> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<!-- 根据主键修改一条记录 --> |
|||
<update id="updateByPk" parameterType="com.xm.core.entity.XmTaskOrder"> |
|||
update xm_task_order |
|||
<set> |
|||
<include refid="set"/> |
|||
</set> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|||
<insert id="batchInsert" parameterType="List"> |
|||
</insert> |
|||
--> |
|||
|
|||
<!-- 批量更新 --> |
|||
<update id="batchUpdate" parameterType="List"> |
|||
<foreach collection="list" item="item" index="index" separator=";" > |
|||
update xm_task_order |
|||
set |
|||
<include refid="batchSet"/> |
|||
where id = #{item.id} |
|||
</foreach> |
|||
</update> |
|||
|
|||
<!-- 批量修改某几个字段 --> |
|||
<delete id="editSomeFields" parameterType="HashMap"> |
|||
update xm_task_order |
|||
<set> |
|||
<include refid="someFieldSet"/> |
|||
</set> |
|||
where (id) in |
|||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|||
( #{item}) |
|||
</foreach> |
|||
</delete> |
|||
<!-- 批量删除 --> |
|||
<delete id="batchDelete" parameterType="List"> |
|||
delete from xm_task_order |
|||
where |
|||
(id) in |
|||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|||
( #{item.id} ) |
|||
</foreach> |
|||
</delete> |
|||
|
|||
|
|||
<!--sql片段 列--> |
|||
<sql id="columns"> |
|||
userid,branch_id,ostatus,ctime,ltime,pay_type,pay_status,pay_time,prepay_id,id,final_fee,oth_fee,origin_fee,pay_at,pay_auth_id,pay_openid,pay_userid,pay_username,discount,top_fee,top_stime,top_etime,hot_fee,hot_stime,hot_etime,top,hot,crm_sup_fee,urgent_fee,urgent,crm_sup,efunds,estate,eto_plat_time,eto_dev_time,eback_time,task_id,top_days,hot_days,urgent_days,urgent_stime,urgent_etime,calc_status,calc_time |
|||
</sql> |
|||
|
|||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|||
<sql id="where"> |
|||
<if test="userid != null and userid != ''"> and res.userid = #{userid} </if> |
|||
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </if> |
|||
<if test="ostatus != null and ostatus != ''"> and res.ostatus = #{ostatus} </if> |
|||
<if test="ctime != null"> and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') </if> |
|||
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if> |
|||
<if test="payType != null and payType != ''"> and res.pay_type = #{payType} </if> |
|||
<if test="payStatus != null and payStatus != ''"> and res.pay_status = #{payStatus} </if> |
|||
<if test="payTime != null"> and date_format(res.pay_time,'%Y-%m-%d') = date_format(#{payTime},'%Y-%m-%d') </if> |
|||
<if test="prepayId != null and prepayId != ''"> and res.prepay_id = #{prepayId} </if> |
|||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|||
<if test="finalFee != null and finalFee != ''"> and res.final_fee = #{finalFee} </if> |
|||
<if test="othFee != null and othFee != ''"> and res.oth_fee = #{othFee} </if> |
|||
<if test="originFee != null and originFee != ''"> and res.origin_fee = #{originFee} </if> |
|||
<if test="payAt != null and payAt != ''"> and res.pay_at = #{payAt} </if> |
|||
<if test="payAuthId != null and payAuthId != ''"> and res.pay_auth_id = #{payAuthId} </if> |
|||
<if test="payOpenid != null and payOpenid != ''"> and res.pay_openid = #{payOpenid} </if> |
|||
<if test="payUserid != null and payUserid != ''"> and res.pay_userid = #{payUserid} </if> |
|||
<if test="payUsername != null and payUsername != ''"> and res.pay_username = #{payUsername} </if> |
|||
<if test="discount != null and discount != ''"> and res.discount = #{discount} </if> |
|||
<if test="topFee != null and topFee != ''"> and res.top_fee = #{topFee} </if> |
|||
<if test="topStime != null"> and date_format(res.top_stime,'%Y-%m-%d') = date_format(#{topStime},'%Y-%m-%d') </if> |
|||
<if test="topEtime != null"> and date_format(res.top_etime,'%Y-%m-%d') = date_format(#{topEtime},'%Y-%m-%d') </if> |
|||
<if test="hotFee != null and hotFee != ''"> and res.hot_fee = #{hotFee} </if> |
|||
<if test="hotStime != null"> and date_format(res.hot_stime,'%Y-%m-%d') = date_format(#{hotStime},'%Y-%m-%d') </if> |
|||
<if test="hotEtime != null"> and date_format(res.hot_etime,'%Y-%m-%d') = date_format(#{hotEtime},'%Y-%m-%d') </if> |
|||
<if test="top != null and top != ''"> and res.top = #{top} </if> |
|||
<if test="hot != null and hot != ''"> and res.hot = #{hot} </if> |
|||
<if test="crmSupFee != null and crmSupFee != ''"> and res.crm_sup_fee = #{crmSupFee} </if> |
|||
<if test="urgentFee != null and urgentFee != ''"> and res.urgent_fee = #{urgentFee} </if> |
|||
<if test="urgent != null and urgent != ''"> and res.urgent = #{urgent} </if> |
|||
<if test="crmSup != null and crmSup != ''"> and res.crm_sup = #{crmSup} </if> |
|||
<if test="efunds != null and efunds != ''"> and res.efunds = #{efunds} </if> |
|||
<if test="estate != null and estate != ''"> and res.estate = #{estate} </if> |
|||
<if test="etoPlatTime != null"> and date_format(res.eto_plat_time,'%Y-%m-%d') = date_format(#{etoPlatTime},'%Y-%m-%d') </if> |
|||
<if test="etoDevTime != null"> and date_format(res.eto_dev_time,'%Y-%m-%d') = date_format(#{etoDevTime},'%Y-%m-%d') </if> |
|||
<if test="ebackTime != null"> and date_format(res.eback_time,'%Y-%m-%d') = date_format(#{ebackTime},'%Y-%m-%d') </if> |
|||
<if test="taskId != null and taskId != ''"> and res.task_id = #{taskId} </if> |
|||
<if test="topDays != null and topDays != ''"> and res.top_days = #{topDays} </if> |
|||
<if test="hotDays != null and hotDays != ''"> and res.hot_days = #{hotDays} </if> |
|||
<if test="urgentDays != null and urgentDays != ''"> and res.urgent_days = #{urgentDays} </if> |
|||
<if test="urgentStime != null"> and date_format(res.urgent_stime,'%Y-%m-%d') = date_format(#{urgentStime},'%Y-%m-%d') </if> |
|||
<if test="urgentEtime != null"> and date_format(res.urgent_etime,'%Y-%m-%d') = date_format(#{urgentEtime},'%Y-%m-%d') </if> |
|||
<if test="calcStatus != null and calcStatus != ''"> and res.calc_status = #{calcStatus} </if> |
|||
<if test="calcTime != null"> and date_format(res.calc_time,'%Y-%m-%d') = date_format(#{calcTime},'%Y-%m-%d') </if> |
|||
</sql> |
|||
<!--sql片段 更新字段 --> |
|||
<sql id="set"> |
|||
userid = #{userid}, |
|||
branch_id = #{branchId}, |
|||
ostatus = #{ostatus}, |
|||
ctime = #{ctime}, |
|||
ltime = #{ltime}, |
|||
pay_type = #{payType}, |
|||
pay_status = #{payStatus}, |
|||
pay_time = #{payTime}, |
|||
prepay_id = #{prepayId}, |
|||
final_fee = #{finalFee}, |
|||
oth_fee = #{othFee}, |
|||
origin_fee = #{originFee}, |
|||
pay_at = #{payAt}, |
|||
pay_auth_id = #{payAuthId}, |
|||
pay_openid = #{payOpenid}, |
|||
pay_userid = #{payUserid}, |
|||
pay_username = #{payUsername}, |
|||
discount = #{discount}, |
|||
top_fee = #{topFee}, |
|||
top_stime = #{topStime}, |
|||
top_etime = #{topEtime}, |
|||
hot_fee = #{hotFee}, |
|||
hot_stime = #{hotStime}, |
|||
hot_etime = #{hotEtime}, |
|||
top = #{top}, |
|||
hot = #{hot}, |
|||
crm_sup_fee = #{crmSupFee}, |
|||
urgent_fee = #{urgentFee}, |
|||
urgent = #{urgent}, |
|||
crm_sup = #{crmSup}, |
|||
efunds = #{efunds}, |
|||
estate = #{estate}, |
|||
eto_plat_time = #{etoPlatTime}, |
|||
eto_dev_time = #{etoDevTime}, |
|||
eback_time = #{ebackTime}, |
|||
task_id = #{taskId}, |
|||
top_days = #{topDays}, |
|||
hot_days = #{hotDays}, |
|||
urgent_days = #{urgentDays}, |
|||
urgent_stime = #{urgentStime}, |
|||
urgent_etime = #{urgentEtime}, |
|||
calc_status = #{calcStatus}, |
|||
calc_time = #{calcTime} |
|||
</sql> |
|||
<sql id="someFieldSet"> |
|||
<if test="userid != null and userid != ''"> userid = #{userid}, </if> |
|||
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if> |
|||
<if test="ostatus != null and ostatus != ''"> ostatus = #{ostatus}, </if> |
|||
<if test="ctime != null"> ctime = #{ctime}, </if> |
|||
<if test="ltime != null"> ltime = #{ltime}, </if> |
|||
<if test="payType != null and payType != ''"> pay_type = #{payType}, </if> |
|||
<if test="payStatus != null and payStatus != ''"> pay_status = #{payStatus}, </if> |
|||
<if test="payTime != null"> pay_time = #{payTime}, </if> |
|||
<if test="prepayId != null and prepayId != ''"> prepay_id = #{prepayId}, </if> |
|||
<if test="finalFee != null and finalFee != ''"> final_fee = #{finalFee}, </if> |
|||
<if test="othFee != null and othFee != ''"> oth_fee = #{othFee}, </if> |
|||
<if test="originFee != null and originFee != ''"> origin_fee = #{originFee}, </if> |
|||
<if test="payAt != null and payAt != ''"> pay_at = #{payAt}, </if> |
|||
<if test="payAuthId != null and payAuthId != ''"> pay_auth_id = #{payAuthId}, </if> |
|||
<if test="payOpenid != null and payOpenid != ''"> pay_openid = #{payOpenid}, </if> |
|||
<if test="payUserid != null and payUserid != ''"> pay_userid = #{payUserid}, </if> |
|||
<if test="payUsername != null and payUsername != ''"> pay_username = #{payUsername}, </if> |
|||
<if test="discount != null and discount != ''"> discount = #{discount}, </if> |
|||
<if test="topFee != null and topFee != ''"> top_fee = #{topFee}, </if> |
|||
<if test="topStime != null"> top_stime = #{topStime}, </if> |
|||
<if test="topEtime != null"> top_etime = #{topEtime}, </if> |
|||
<if test="hotFee != null and hotFee != ''"> hot_fee = #{hotFee}, </if> |
|||
<if test="hotStime != null"> hot_stime = #{hotStime}, </if> |
|||
<if test="hotEtime != null"> hot_etime = #{hotEtime}, </if> |
|||
<if test="top != null and top != ''"> top = #{top}, </if> |
|||
<if test="hot != null and hot != ''"> hot = #{hot}, </if> |
|||
<if test="crmSupFee != null and crmSupFee != ''"> crm_sup_fee = #{crmSupFee}, </if> |
|||
<if test="urgentFee != null and urgentFee != ''"> urgent_fee = #{urgentFee}, </if> |
|||
<if test="urgent != null and urgent != ''"> urgent = #{urgent}, </if> |
|||
<if test="crmSup != null and crmSup != ''"> crm_sup = #{crmSup}, </if> |
|||
<if test="efunds != null and efunds != ''"> efunds = #{efunds}, </if> |
|||
<if test="estate != null and estate != ''"> estate = #{estate}, </if> |
|||
<if test="etoPlatTime != null"> eto_plat_time = #{etoPlatTime}, </if> |
|||
<if test="etoDevTime != null"> eto_dev_time = #{etoDevTime}, </if> |
|||
<if test="ebackTime != null"> eback_time = #{ebackTime}, </if> |
|||
<if test="taskId != null and taskId != ''"> task_id = #{taskId}, </if> |
|||
<if test="topDays != null and topDays != ''"> top_days = #{topDays}, </if> |
|||
<if test="hotDays != null and hotDays != ''"> hot_days = #{hotDays}, </if> |
|||
<if test="urgentDays != null and urgentDays != ''"> urgent_days = #{urgentDays}, </if> |
|||
<if test="urgentStime != null"> urgent_stime = #{urgentStime}, </if> |
|||
<if test="urgentEtime != null"> urgent_etime = #{urgentEtime}, </if> |
|||
<if test="calcStatus != null and calcStatus != ''"> calc_status = #{calcStatus}, </if> |
|||
<if test="calcTime != null"> calc_time = #{calcTime}, </if> |
|||
</sql> |
|||
<!--sql片段 批量更新 --> |
|||
<sql id="batchSet"> |
|||
userid = #{item.userid}, |
|||
branch_id = #{item.branchId}, |
|||
ostatus = #{item.ostatus}, |
|||
ctime = #{item.ctime}, |
|||
ltime = #{item.ltime}, |
|||
pay_type = #{item.payType}, |
|||
pay_status = #{item.payStatus}, |
|||
pay_time = #{item.payTime}, |
|||
prepay_id = #{item.prepayId}, |
|||
final_fee = #{item.finalFee}, |
|||
oth_fee = #{item.othFee}, |
|||
origin_fee = #{item.originFee}, |
|||
pay_at = #{item.payAt}, |
|||
pay_auth_id = #{item.payAuthId}, |
|||
pay_openid = #{item.payOpenid}, |
|||
pay_userid = #{item.payUserid}, |
|||
pay_username = #{item.payUsername}, |
|||
discount = #{item.discount}, |
|||
top_fee = #{item.topFee}, |
|||
top_stime = #{item.topStime}, |
|||
top_etime = #{item.topEtime}, |
|||
hot_fee = #{item.hotFee}, |
|||
hot_stime = #{item.hotStime}, |
|||
hot_etime = #{item.hotEtime}, |
|||
top = #{item.top}, |
|||
hot = #{item.hot}, |
|||
crm_sup_fee = #{item.crmSupFee}, |
|||
urgent_fee = #{item.urgentFee}, |
|||
urgent = #{item.urgent}, |
|||
crm_sup = #{item.crmSup}, |
|||
efunds = #{item.efunds}, |
|||
estate = #{item.estate}, |
|||
eto_plat_time = #{item.etoPlatTime}, |
|||
eto_dev_time = #{item.etoDevTime}, |
|||
eback_time = #{item.ebackTime}, |
|||
task_id = #{item.taskId}, |
|||
top_days = #{item.topDays}, |
|||
hot_days = #{item.hotDays}, |
|||
urgent_days = #{item.urgentDays}, |
|||
urgent_stime = #{item.urgentStime}, |
|||
urgent_etime = #{item.urgentEtime}, |
|||
calc_status = #{item.calcStatus}, |
|||
calc_time = #{item.calcTime} |
|||
</sql> |
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue