Commit 94413733 authored by zjy's avatar zjy

user/role/tright 7.12

parent 69d970e2
......@@ -27,14 +27,14 @@ public class WechatUserDaoImpl extends BaseDaoImpl implements WechatUserDao {
register(WechatUserVo.class);
table.add(GET_USER_NUM,"select count(id) as num from pd_wechat_user where 1=1 ")
.add("companyId","and company_id = ? ")
.add("sourceCompanyId","and source_company_id = ? ")
.add("start","and subscribe_date >= ? ")
.add("end","and subscribe_date < ? ");
table.add(GET_USER_LIST,"select * from pd_wechat_user where 1=1 ")
.add("start","and subscribe_date >= ? ")
.add("end","and subscribe_date < ? ")
.add("companyId","and company_id = ? order by subscribe_date desc");
.add("sourceCompanyId","and source_company_id = ? order by subscribe_date desc");
}
@Override
......
......@@ -198,26 +198,39 @@ public class DataServiceImpl implements DataService {
TyyTouristVo tyyTouristVo = reqVo.getTyyTouristVo();
OrderRelVo orderRelVo = reqVo.getOrderRelVo();
/*OrderVo表*/
saveOrderVoStepThree(tyyOrdersVo,tyyOrderbackVoList,orderRelVo);
if (null != tyyOrdersVo){
saveOrderVoStepThree(tyyOrdersVo,tyyOrderbackVoList,orderRelVo);
}
/*OrderExtendVo表*/
saveOrderExtendVoStepThree(tyyOrdersVo);
if (null != tyyOrdersVo){
saveOrderExtendVoStepThree(tyyOrdersVo);
}
/*OrderRefundVo表*/
saveOrderRefundVoStepThree(tyyOrderbackVoList);
if (null != tyyOrderbackVoList){
saveOrderRefundVoStepThree(tyyOrderbackVoList);
}
/*OrderStatusVo表*/
saveOrderStatusVoStepThree(tyyOrdersVo);
if (null != tyyOrdersVo){
saveOrderStatusVoStepThree(tyyOrdersVo);
}
/*OrderTicketDetailVo表*/
saveOrderTicketDetailVoStepThree(tyyOrderdetailsVo,tyyOrdersVo);
if (null != tyyOrderdetailsVo && null != tyyOrdersVo){
saveOrderTicketDetailVoStepThree(tyyOrderdetailsVo,tyyOrdersVo);
}
/*OrderTouristVo表*/
saveOrderTouristVoStepThree(tyyTouristVo);
if (null != tyyTouristVo){
saveOrderTouristVoStepThree(tyyTouristVo);
}
/*DiscountDetailVo表*/
saveDiscountDetailVoStepThree(tyyOrdersVo);
if (null != tyyOrdersVo){
saveDiscountDetailVoStepThree(tyyOrdersVo);
}
}
private void saveDiscountDetailVoStepThree(TyyOrdersVo tyyOrdersVo) {
......@@ -388,10 +401,12 @@ public class DataServiceImpl implements DataService {
double pdRefundMoney = 0d;
double refundMoney = 0d;
for (TyyOrderbackVo tyyOrderbackVo:tyyOrderbackVoList) {
refundNum += tyyOrderbackVo.getRefundnum();
refundFee += tyyOrderbackVo.getRefundFee();
pdRefundMoney += tyyOrderbackVo.getReceiveMoney();
refundMoney += tyyOrderbackVo.getRefundMoney();
if (null != tyyOrderbackVo){
refundNum += tyyOrderbackVo.getRefundnum();
refundFee += tyyOrderbackVo.getRefundFee();
pdRefundMoney += tyyOrderbackVo.getReceiveMoney();
refundMoney += tyyOrderbackVo.getRefundMoney();
}
}
OrderVo orderVo = new OrderVo();
if (null != orderRelVo){
......@@ -411,7 +426,9 @@ public class DataServiceImpl implements DataService {
orderVo.setTicket_phone(tyyOrdersVo.getUsertel());
orderVo.setCost_price(tyyOrdersVo.getPurchaseprice());
orderVo.setCost_total_money(tyyOrdersVo.getPurchaseprice()*tyyOrdersVo.getBuynum());
orderVo.setOrder_money(orderVo.getCost_total_money()-tyyOrdersVo.getDiscountprice());
if (null != tyyOrdersVo.getDiscountprice() && null != orderVo.getCost_total_money()){
orderVo.setOrder_money(orderVo.getCost_total_money()-tyyOrdersVo.getDiscountprice());
}
orderVo.setRefund_fee(refundFee);
orderVo.setPd_refund_money(pdRefundMoney);
orderVo.setDiscount_money(tyyOrdersVo.getDiscountprice());
......@@ -444,26 +461,39 @@ public class DataServiceImpl implements DataService {
TyyTouristVo tyyTouristVo = reqVo.getTyyTouristVo();
/*pd_order*/
saveOrderVoStepOne(tyyOrderVo,tyyOrderMixVo,tyyOrderbackVoList);
if (null != tyyOrderVo || null != tyyOrderMixVo){
saveOrderVoStepOne(tyyOrderVo,tyyOrderMixVo,tyyOrderbackVoList);
}
/*pd_order_status*/
saveOrderStatusVoStepOne(tyyOrderVo,tyyOrderMixVo);
if (null != tyyOrderVo || null != tyyOrderMixVo){
saveOrderStatusVoStepOne(tyyOrderVo,tyyOrderMixVo);
}
/*pd_order_extend*/
saveOrderExtendVoStepOne(tyyOrderVo,tyyOrderMixVo);
if (null != tyyOrderVo || null != tyyOrderMixVo){
saveOrderExtendVoStepOne(tyyOrderVo,tyyOrderMixVo);
}
/*pd_discount_detail*/
saveDiscountDetailVoStepOne(tyyOrderVo,tyyOrderMixVo);
if (null != tyyOrderVo || null != tyyOrderMixVo){
saveDiscountDetailVoStepOne(tyyOrderVo,tyyOrderMixVo);
}
/*pd_order_ticket_detail*/
saveOrderTicketDetailVoStepOne(tyyOrderVo,tyyOrderMixVo,tyyOrderdetailsVo);
if ((null != tyyOrderVo || null != tyyOrderMixVo) && null != tyyOrderdetailsVo){
saveOrderTicketDetailVoStepOne(tyyOrderVo,tyyOrderMixVo,tyyOrderdetailsVo);
}
/*pd_order_refund*/
saveOrderRefundVoStepOne(tyyOrderbackVoList);
if (null != tyyOrderbackVoList){
saveOrderRefundVoStepOne(tyyOrderbackVoList);
}
/*OrderTouristVo表*/
saveOrderTouristVoStepOne(tyyTouristVo);
if (null != tyyTouristVo){
saveOrderTouristVoStepOne(tyyTouristVo);
}
}
private void saveOrderTouristVoStepOne(TyyTouristVo tyyTouristVo) {
......@@ -523,10 +553,12 @@ public class DataServiceImpl implements DataService {
}else {
orderTicketDetailVo.setTicket_status(Integer.parseInt(tyyOrderdetailsVo.getCodestatus()));
}
if ("1".equals(tyyOrderdetailsVo.getCodestatus())){
orderTicketDetailVo.setTime(tyyOrderdetailsVo.getChecktime());
}else if("2".equals(tyyOrderdetailsVo.getCodestatus())){
orderTicketDetailVo.setTime(tyyOrderdetailsVo.getRefundtime());
if (null != tyyOrderdetailsVo.getCodestatus()){
if ("1".equals(tyyOrderdetailsVo.getCodestatus())){
orderTicketDetailVo.setTime(tyyOrderdetailsVo.getChecktime());
}else if("2".equals(tyyOrderdetailsVo.getCodestatus())){
orderTicketDetailVo.setTime(tyyOrderdetailsVo.getRefundtime());
}
}
orderTicketDetailVo.setTicket_code(tyyOrderdetailsVo.getLinkid());
orderTicketDetailVo.setCode_url(tyyOrderdetailsVo.getPicUrl());
......@@ -628,10 +660,12 @@ public class DataServiceImpl implements DataService {
orderStatusVo.setPay_type(tyyOrderVo.getPay_type());
orderStatusVo.setPay_third_id(tyyOrderVo.getPay_type_id());
orderStatusVo.setPayment_time(tyyOrderVo.getPay_date());
if (tyyOrderVo.getPay_status() == 0){
orderStatusVo.setPayment_status(0);
}else{
orderStatusVo.setPayment_status(1);
if (null != tyyOrderVo.getPay_status()){
if (tyyOrderVo.getPay_status() == 0){
orderStatusVo.setPayment_status(0);
}else{
orderStatusVo.setPayment_status(1);
}
}
orderStatusVo.setPayment_id(tyyOrderVo.getTongl_third_ordersn());
orderStatusVo.setPay_tonglian_id(tyyOrderVo.getTongl_ordersn());
......@@ -654,10 +688,12 @@ public class DataServiceImpl implements DataService {
orderStatusVo.setOrder_status(Integer.parseInt(tyyOrderMixVo.getOrder_status()));
}
orderStatusVo.setThird_order_id(tyyOrderMixVo.getPiaostorderid());
if ("N".equals(tyyOrderMixVo.getEmancipated())){
orderStatusVo.setIs_summarize(0);
}else{
orderStatusVo.setIs_summarize(1);
if (null != tyyOrderMixVo.getEmancipated()){
if ("N".equals(tyyOrderMixVo.getEmancipated())){
orderStatusVo.setIs_summarize(0);
}else{
orderStatusVo.setIs_summarize(1);
}
}
orderStatusVo.setSummarize_time(tyyOrderMixVo.getEmancipated_date());
if (null == tyyOrderMixVo.getProfit_checked()){
......@@ -705,7 +741,9 @@ public class DataServiceImpl implements DataService {
orderVo.setPd_order_money(tyyOrderVo.getReal_price());
orderVo.setCost_price(tyyOrderVo.getSettlement_price());
orderVo.setCost_total_money(tyyOrderVo.getCost_price());
orderVo.setOrder_money(orderVo.getCost_total_money()-tyyOrderVo.getDiscount_price());
if (null != orderVo.getCost_total_money() && null != tyyOrderVo.getDiscount_price()){
orderVo.setOrder_money(orderVo.getCost_total_money()-tyyOrderVo.getDiscount_price());
}
orderVo.setOrder_fee(tyyOrderVo.getOrder_poundage_price());
orderVo.setRefund_num(tyyOrderVo.getReturn_num());
orderVo.setRefund_money(tyyOrderVo.getReturn_money());
......@@ -725,7 +763,9 @@ public class DataServiceImpl implements DataService {
orderVo.setOrder_time(tyyOrderMixVo.getOrdertime());
orderVo.setCost_price(tyyOrderMixVo.getPurchaseprice());
orderVo.setCost_total_money(orderVo.getCost_price()*orderVo.getOrder_num());
orderVo.setOrder_money(orderVo.getCost_total_money()-tyyOrderMixVo.getDiscountprice());
if (null != orderVo.getCost_total_money() && null != tyyOrderMixVo.getDiscountprice()){
orderVo.setOrder_money(orderVo.getCost_total_money()-tyyOrderMixVo.getDiscountprice());
}
if (null == tyyOrderMixVo.getSub_order_type()){
orderVo.setSub_order_type(0);
}else {
......@@ -744,7 +784,9 @@ public class DataServiceImpl implements DataService {
}
double refundFee = 0d;
for (TyyOrderbackVo tyyOrderbackVo:tyyOrderbackVoList) {
refundFee += tyyOrderbackVo.getRefundFee();
if (null != tyyOrderbackVo){
refundFee += tyyOrderbackVo.getRefundFee();
}
}
orderVo.setRefund_fee(refundFee);
/*若存在则修改,不存在则添加*/
......
......@@ -65,7 +65,7 @@ public class IndexServiceImpl implements IndexService {
@Override
public Integer getUserPrecipitation(UserPrecipitationReqVo reqVo) {
WechatUserGetReqVo getReqVo = new WechatUserGetReqVo();
getReqVo.setCompanyId(reqVo.getId());
getReqVo.setSourceCompanyId(reqVo.getId());
List<WechatUserVo> wechatUserVoList = wechatUserDaoImpl.loadList(getReqVo, WechatUserVo.class);
if (null == wechatUserVoList || wechatUserVoList.isEmpty()){
return 0;
......@@ -119,7 +119,7 @@ public class IndexServiceImpl implements IndexService {
,TimeConstant.DECEMBER_BEGIN
,TimeConstant.YEAR_END};
WechatUserGetReqVo getReqVo = new WechatUserGetReqVo();
getReqVo.setCompanyId(reqVo.getId());
getReqVo.setSourceCompanyId(reqVo.getId());
for (int i = 0; i < monthList.length-1; i++) {
getReqVo.setStart(monthList[i]);
getReqVo.setEnd(monthList[i+1]);
......
......@@ -196,7 +196,7 @@ public class PangdingPartnerServiceImpl implements PangdingPartnerService {
resVo.setCompanyId(reqVo.getCompanyId());
/*今日沉淀量*/
WechatUserGetReqVo todayGetReqVo = new WechatUserGetReqVo();
todayGetReqVo.setCompanyId(reqVo.getCompanyId());
todayGetReqVo.setSourceCompanyId(reqVo.getCompanyId());
todayGetReqVo.setStart(DateHelper.getNow().substring(0,10)+" 00:00:00");
todayGetReqVo.setEnd(DateHelper.getNow().substring(0,10)+" 23:59:59");
List<Map> todayList = (List<Map>) wechatUserDaoImpl.getUserNum(todayGetReqVo);
......@@ -204,13 +204,13 @@ public class PangdingPartnerServiceImpl implements PangdingPartnerService {
resVo.setTodayPrecipitation(today);
/*总沉淀量*/
WechatUserGetReqVo totalGetReqVo = new WechatUserGetReqVo();
totalGetReqVo.setCompanyId(reqVo.getCompanyId());
totalGetReqVo.setSourceCompanyId(reqVo.getCompanyId());
List<Map> totalList = (List<Map>) wechatUserDaoImpl.getUserNum(totalGetReqVo);
Long total = (Long) totalList.get(0).get("num");
resVo.setTotalPrecipitation(total);
/*沉淀用户分页列表*/
WechatUserGetReqVo userListGetReqVo = new WechatUserGetReqVo();
userListGetReqVo.setCompanyId(reqVo.getCompanyId());
userListGetReqVo.setSourceCompanyId(reqVo.getCompanyId());
PageSizeData<WechatUserVo> wechatUserVoList = wechatUserDaoImpl.getUserList(reqVo);
resVo.setWechatUserVoList(wechatUserVoList);
return resVo;
......
......@@ -12,32 +12,30 @@ import java.math.BigDecimal;
* @create 2019/5/29 16:25
*/
@TableAnnotation("pd_wechat_user")
public class WechatUserVo extends BaseVo implements InitDao {
public class WechatUserVo extends BaseVo {
private String id;
private String nickname;
private Integer gender;
private String unionid;
private String openid;
@TableAnnotation("company_id")
private String companyId;
private String nickname;
private String integral;
private Integer gender;
private BigDecimal cash;
private String age;
@TableAnnotation("head_portrait")
private String headPortrait;
private String address;
private String status;
private String integral;
private BigDecimal cash;
private String age;
@TableAnnotation("subscribe_status")
private Integer subscribeStatus;
@TableAnnotation("subscribe_date")
private String subcribeDate;
......@@ -45,6 +43,23 @@ public class WechatUserVo extends BaseVo implements InitDao {
@TableAnnotation("unsubscribe_date")
private String unSubcribeDate;
@TableAnnotation("create_date")
private String createDate;
@TableAnnotation("source_company_id")
private String sourceCompanyId;
@TableAnnotation("from_company_id")
private String fromCompanyId;
@TableAnnotation("from_company_pid")
private String fromCompanyPid;
private Integer level;
@TableAnnotation("subscribe_scene")
private String subscribeScene;
public String getId() {
return id;
}
......@@ -85,14 +100,6 @@ public class WechatUserVo extends BaseVo implements InitDao {
this.openid = openid;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getIntegral() {
return integral;
}
......@@ -125,14 +132,6 @@ public class WechatUserVo extends BaseVo implements InitDao {
this.address = address;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getAge() {
return age;
}
......@@ -157,8 +156,59 @@ public class WechatUserVo extends BaseVo implements InitDao {
this.unSubcribeDate = unSubcribeDate;
}
@Override
public void init() {
public Integer getSubscribeStatus() {
return subscribeStatus;
}
public void setSubscribeStatus(Integer subscribeStatus) {
this.subscribeStatus = subscribeStatus;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getSourceCompanyId() {
return sourceCompanyId;
}
public void setSourceCompanyId(String sourceCompanyId) {
this.sourceCompanyId = sourceCompanyId;
}
public String getFromCompanyId() {
return fromCompanyId;
}
public void setFromCompanyId(String fromCompanyId) {
this.fromCompanyId = fromCompanyId;
}
public String getFromCompanyPid() {
return fromCompanyPid;
}
public void setFromCompanyPid(String fromCompanyPid) {
this.fromCompanyPid = fromCompanyPid;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getSubscribeScene() {
return subscribeScene;
}
public void setSubscribeScene(String subscribeScene) {
this.subscribeScene = subscribeScene;
}
}
......@@ -7,7 +7,7 @@ package com.pangding.web.authority.vo.reqvo;
public class WechatUserGetReqVo {
private String reqId;
private String companyId;
private String sourceCompanyId;
private String start;
......@@ -37,11 +37,11 @@ public class WechatUserGetReqVo {
this.reqId = reqId;
}
public String getCompanyId() {
return companyId;
public String getSourceCompanyId() {
return sourceCompanyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
public void setSourceCompanyId(String sourceCompanyId) {
this.sourceCompanyId = sourceCompanyId;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment