Merge branch 'develop'

master
duLingLing 5 years ago
commit df2ca7aa75

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -9,6 +9,8 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Created by yixian on 2016-09-12.
*/
@ -45,4 +47,6 @@ public interface ClientDeviceMapper {
PageList<JSONObject> listDevices(JSONObject params, PageBounds pagination);
void deviceOffline(@Param("account_id") String accountId);
List<JSONObject> listClientDeviceIds(JSONObject params);
}

@ -203,6 +203,15 @@ public interface ClientManager {
JSONObject listClientDevices(JSONObject manager, String clientMoniker, String remark, int page, int limit, String client_type, String[] client_ids);
/**
* Id
* @param clientMoniker
* @param client_type
* @param client_ids
* @return
*/
JSONObject listClientDeviceIds(String clientMoniker, String client_type, String[] client_ids);
void updateDevie(JSONObject manager, String clientMoniker, String devId, String remark);
void toggleDeviceAvailable(JSONObject manager, String clientMoniker, String devId, boolean enable);

@ -2573,6 +2573,27 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return PageListUtils.buildPageListResult(devices);
}
@Override
public JSONObject listClientDeviceIds(String clientMoniker, String client_type, String[] client_ids) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(null, client);
JSONObject params = new JSONObject();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
sdf.setTimeZone(TimeZone.getTimeZone(client.getString("timezone") != null ? client.getString("timezone") : "Australia/Melbourne"));
params.put("client_id", client.getIntValue("client_id"));
if (client_ids != null) {
params.put("client_ids", Arrays.asList(client_ids));
params.remove("client_id");
}
List<JSONObject> deviceIds = clientDeviceMapper.listClientDeviceIds(params);
return new JSONObject(){{
put("data",deviceIds);
}};
}
@Override
@Transactional
public void addDevice(JSONObject manager, String clientMoniker, JSONObject newDevice) {

@ -364,6 +364,13 @@ public class PartnerViewController {
return clientManager.listClientDevices(null, account.getString("client_moniker"), remark, page, limit, client_type, client_ids);
}
@PartnerMapping(value = "/device_ids", method = RequestMethod.GET, roles = PartnerRole.ADMIN)
@ResponseBody
public JSONObject listClientDeviceIds(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,
@RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids) {
return clientManager.listClientDeviceIds(account.getString("client_moniker"), client_type, client_ids);
}
@PartnerMapping(value = "/devices/{devId}", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void modifyDevice(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String devId, @RequestBody JSONObject remark) {

@ -510,7 +510,7 @@
and o.client_order_id = #{search_text}
</if>
</if>
<if test="dev_id!=null">and dev_id=#{dev_id}</if>
<if test="dev_id!=null">and binary dev_id=#{dev_id}</if>
<if test="trade_type!=null">and o.gateway in
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">#{gateway}</foreach>
</if>
@ -664,7 +664,7 @@
<if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
<if test="date!=null">and date(o.create_time)=date(#{date})</if>
<if test="dev_id!=null">and o.dev_id=#{dev_id}</if>
<if test="dev_id!=null">and binary o.dev_id=#{dev_id}</if>
<if test="status!=null">
and
<foreach collection="status" item="std" open="(" close=")" separator=" or ">o.status=#{std}</foreach>

@ -170,7 +170,7 @@
<if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="dev_id!=null">
and o.dev_id = #{dev_id}
and binary o.dev_id = #{dev_id}
</if>
<if test="channel!=null">
and
@ -241,7 +241,7 @@
<if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="dev_id!=null">
and o.dev_id = #{dev_id}
and binary o.dev_id = #{dev_id}
</if>
<if test="channel!=null">
and

@ -22,6 +22,23 @@
</if>
</where>
</select>
<select id="listClientDeviceIds" resultType="com.alibaba.fastjson.JSONObject">
SELECT o.dev_id
FROM pmt_orders AS o
WHERE o.dev_id IS NOT NULL
<if test="client_ids!=null">
AND o.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_id!=null and client_ids==null">
AND o.client_id=#{client_id}
</if>
AND o.gateway in(5,6)
GROUP BY o.dev_id
ORDER BY o.dev_id ASC
</select>
<select id="listDevices" resultType="com.alibaba.fastjson.JSONObject">
SELECT d.*,c.client_moniker,c.short_name client_name FROM sys_clients_devices d
LEFT JOIN sys_clients c on c.client_id=d.client_id

@ -116,6 +116,17 @@
</p>
</div>
</div>
<div class="form-group col-xs-12" ng-if="deviceIds.length">
<label class="control-label col-xs-4 col-sm-2">Third Device</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':order_device_isAll}" ng-click="chooseDeviceIds('all')">All</a>
<label ng-repeat="dev in deviceIds">
|&nbsp;<a role="button" ng-class="{'bg-primary':dev.dev_id==choose_order_device_id}" ng-click="chooseDeviceIds(dev.dev_id)">{{dev.dev_id}}</a>&nbsp;
</label>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10 col-xs-8">

@ -292,6 +292,17 @@
</p>
</div>
</div>
<div class="form-group col-xs-12" ng-if="deviceIds.length">
<label class="control-label col-xs-4 col-sm-2">Third Device</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':order_device_isAll}" ng-click="chooseDeviceIds('all')">All</a>
<label ng-repeat="dev in deviceIds">
|&nbsp;<a role="button" ng-class="{'bg-primary':dev.dev_id==choose_order_device_id}" ng-click="chooseDeviceIds(dev.dev_id)">{{dev.dev_id}}</a>&nbsp;
</label>
</p>
</div>
</div>
<div class="form-group col-xs-12" ng-if="devices.length">
<label class="control-label col-xs-4 col-sm-2">Devices</label>
<div class="col-sm-10 col-xs-8">

@ -24,6 +24,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.isAll = true;
$scope.isLevel3All = true;
$scope.device_isAll = true;
$scope.order_device_isAll = true;
$scope.dev_params = {client_type:'sunmi',limit:100};
$scope.clients = [$scope.currentUser.client];
$scope.showLevel3Clients = false;
@ -188,6 +189,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.dev_params.client_ids = angular.copy($scope.clientIds);
$scope.showLevel3Clients = false;
$scope.listDevices();
$scope.listDevicesIds();
} else if (client.level3Clients) {
$scope.chooseClientId = client.client_id;
$scope.showLevel3Clients = true;
@ -207,6 +209,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.dev_params.client_ids = [client.client_id];
$scope.showLevel3Clients = false;
$scope.listDevices();
$scope.listDevicesIds();
}
$scope.loadTradeLogs();
};
@ -218,12 +221,14 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.chooseLevel3ClientId = '';
$scope.dev_params.client_ids = angular.copy($scope.level3ClientIds);
$scope.listDevices();
$scope.listDevicesIds();
} else {
$scope.chooseLevel3ClientId = client.client_id;
$scope.params.client_ids = [client.client_id];
$scope.isLevel3All = false;
$scope.dev_params.client_ids = [client.client_id];
$scope.listDevices();
$scope.listDevicesIds();
}
$scope.loadTradeLogs();
};
@ -234,6 +239,12 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.devices = resp.data.data;
})
};
$scope.listDevicesIds = function () {
var params = angular.copy($scope.params)
$http.get('/client/partner_info/device_ids',{params: params}).then(function (resp) {
$scope.deviceIds = resp.data.data;
})
};
$scope.chooseDevices = function (dev_id) {
if(dev_id == 'all'){
$scope.chooseDevice_id = '';
@ -244,10 +255,28 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.chooseDevice_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = false;
$scope.order_device_isAll = true;
$scope.choose_order_device_id = '';
$scope.loadTradeLogs(1);
}
};
$scope.chooseDeviceIds = function (dev_id) {
if(dev_id == 'all'){
$scope.choose_order_device_id = '';
$scope.params.dev_id = null;
$scope.order_device_isAll = true;
$scope.loadTradeLogs(1);
}else {
$scope.choose_order_device_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = true;
$scope.order_device_isAll = false;
$scope.chooseDevice_id = '';
$scope.loadTradeLogs(1);
}
};
$scope.listDevices();
$scope.listDevicesIds();
if ($scope.currentUser.client.has_children) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
@ -265,8 +294,8 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.loadTradeLogs(1);
$scope.listDevicesIds();
//console.log($rootScope.currentUser.client.clientList);
})
}else{

@ -19,6 +19,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.params.channel = 'ALL'
$scope.dev_params = {client_type:'sunmi',limit:100};
$scope.device_isAll = true;
$scope.order_device_isAll = true;
$scope.params.trans_type = 0;
$scope.isAll = true;
$scope.clients = [$scope.currentUser.client];
@ -66,6 +67,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.devices = resp.data.data;
})
};
$scope.listDevicesIds = function () {
var params = angular.copy($scope.params)
$http.get('/client/partner_info/device_ids',{params: params}).then(function (resp) {
$scope.deviceIds = resp.data.data;
})
};
$scope.chooseDevices = function (dev_id) {
if(dev_id == 'all'){
$scope.chooseDevice_id = '';
@ -76,10 +84,26 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.chooseDevice_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = false;
$scope.order_device_isAll = true;
$scope.loadTradeLogs(1);
}
};
$scope.chooseDeviceIds = function (dev_id) {
if(dev_id == 'all'){
$scope.choose_order_device_id = '';
$scope.params.dev_id = null;
$scope.order_device_isAll = true;
$scope.loadTradeLogs(1);
}else {
$scope.choose_order_device_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = true;
$scope.order_device_isAll = false;
$scope.loadTradeLogs(1);
}
};
$scope.listDevices();
$scope.listDevicesIds();
$scope.loadTradeLogs = function (page) {
var params = angular.copy($scope.params);
if (params.datefrom) {
@ -96,6 +120,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
$scope.chooseClient = function (client) {
if (client == 'all') {
@ -105,6 +130,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.dev_params.client_ids = angular.copy($scope.clientIds);
$scope.showLevel3Clients = false;
$scope.listDevices();
$scope.listDevicesIds();
} else if (client.level3Clients) {
$scope.chooseClientId = client.client_id;
$scope.showLevel3Clients = true;
@ -124,6 +150,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.dev_params.client_ids = [client.client_id];
$scope.showLevel3Clients = false;
$scope.listDevices();
$scope.listDevicesIds();
}
$scope.loadTradeLogs();
};
@ -134,12 +161,14 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.chooseLevel3ClientId = '';
$scope.dev_params.client_ids = angular.copy($scope.level3ClientIds);
$scope.listDevices();
$scope.listDevicesIds();
} else {
$scope.chooseLevel3ClientId = client.client_id;
$scope.params.client_ids = [client.client_id];
$scope.isLevel3All = false;
$scope.dev_params.client_ids = [client.client_id];
$scope.listDevices();
$scope.listDevicesIds();
}
$scope.loadTradeLogs();
};

Loading…
Cancel
Save