Merge remote-tracking branch 'origin/develop' into develop

master
yuan 7 years ago
commit af0c5a8cae

@ -401,7 +401,12 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format");
} }
params.put("channel",record.getString("channel")); params.put("channel",record.getString("channel"));
int newCustomers = transactionAnalysisMapper.countNewCustomers(params); int newCustomers = 0;
if (client.getIntValue("client_id")==0){
newCustomers = transactionAnalysisMapper.getCountCustomers(params.getDate("end")) - transactionAnalysisMapper.getCountCustomers(params.getDate("begin"));
}else {
newCustomers = transactionAnalysisMapper.countNewCustomers(params);
}
int oldCustomers = transactionAnalysisMapper.countOldCustomers(params); int oldCustomers = transactionAnalysisMapper.countOldCustomers(params);
record.put("new_customers",newCustomers); record.put("new_customers",newCustomers);
record.put("old_customers",oldCustomers); record.put("old_customers",oldCustomers);

@ -69,4 +69,6 @@ public interface TransactionAnalysisMapper {
BigDecimal getOneOrder(@Param("order_id") String order_id); BigDecimal getOneOrder(@Param("order_id") String order_id);
int getCountCustomers(@Param("date") Date date);
} }

@ -3,9 +3,11 @@ package au.com.royalpay.payment.manage.apps.web;
import au.com.royalpay.payment.manage.apps.AppController; import au.com.royalpay.payment.manage.apps.AppController;
import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery; import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery;
import au.com.royalpay.payment.manage.apps.core.CustomerImpression; import au.com.royalpay.payment.manage.apps.core.CustomerImpression;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -22,20 +24,21 @@ public class CustomerImpressionController {
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public JSONObject list(CustomerImpressionQuery customerImpressionQuery) { public JSONObject list(CustomerImpressionQuery customerImpressionQuery,@ModelAttribute(CommonConsts.APP_INFO) JSONObject app) {
customerImpressionQuery.setClient_id(app.getInteger("client_id"));
return customerImpression.listPageble(customerImpressionQuery); return customerImpression.listPageble(customerImpressionQuery);
} }
@RequestMapping(value = "/{client_id}/{customer_id}", method = RequestMethod.GET) @RequestMapping(value = "/{customer_id}", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public JSONObject find(@PathVariable int client_id,@PathVariable String customer_id) { public JSONObject find(@PathVariable String customer_id,@ModelAttribute(CommonConsts.APP_INFO) JSONObject app) {
return customerImpression.findOne(client_id,customer_id); return customerImpression.findOne(app.getIntValue("client_id"),customer_id);
} }
@RequestMapping(value = "/{client_id}/{customer_id}", method = RequestMethod.PUT) @RequestMapping(value = "/{customer_id}", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public void modifyNameRemark(@PathVariable int client_id, @PathVariable String customer_id, @RequestBody JSONObject customerInfo) { public void modifyNameRemark(@PathVariable String customer_id, @RequestBody JSONObject customerInfo,@ModelAttribute(CommonConsts.APP_INFO) JSONObject app) {
customerImpression.modifyNameRemark(client_id,customer_id,customerInfo.getString("name_remark")); customerImpression.modifyNameRemark(app.getIntValue("client_id"),customer_id,customerInfo.getString("name_remark"));
} }
} }

@ -389,6 +389,12 @@
]]> ]]>
</select> </select>
<select id="getCountCustomers" resultType="java.lang.Integer">
<![CDATA[
SELECT count(DISTINCT o.customer_id) FROM pmt_orders o where
o.create_time < #{date} and o.status>=5
]]>
</select>
<select id="getTradePartnersInTypes" resultType="com.alibaba.fastjson.JSONObject"> <select id="getTradePartnersInTypes" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[

@ -3,7 +3,7 @@
<mapper namespace="au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper"> <mapper namespace="au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper">
<select id="listCustomerInfo" resultType="com.alibaba.fastjson.JSONObject"> <select id="listCustomerInfo" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT
* client_id,customer_id,name_remak,headimg,nick_name,tag,payment_times,total_amount,update_time,channel
FROM sys_clients_customers FROM sys_clients_customers
where where
client_id = #{client_id} client_id = #{client_id}

@ -29,6 +29,7 @@ $(function () {
} }
}); });
function loadEncourage() { function loadEncourage() {
$.ajax({ $.ajax({
url: '/act/encourage_money/orders/' + window.order_id, url: '/act/encourage_money/orders/' + window.order_id,
@ -44,9 +45,11 @@ $(function () {
} }
}) })
} }
loadEncourage(); loadEncourage();
function loadPoints() { function loadPoints() {
if ([0, 1, 2, 11].indexOf(window.order_gateway) >= 0) {
$.ajax({ $.ajax({
url: '/customers/points/' + window.order_id + '/check', url: '/customers/points/' + window.order_id + '/check',
method: 'GET', method: 'GET',
@ -61,6 +64,8 @@ $(function () {
} }
}); });
} }
}
loadPoints(); loadPoints();
$('.encourage-dialog .close-circle').click(function () { $('.encourage-dialog .close-circle').click(function () {

Loading…
Cancel
Save