Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-supervisor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6e4b2d3b
authored
Mar 16, 2026
by
范富荣
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改查询督导任务管理模块接口
1 parent
b71f8f67
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1066 additions
and
855 deletions
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/SupervisorTaskDTO.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/SupervisorTaskSummaryDTO.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoService.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorWarningBaselineConfigService.java
rpc-dj-supervisor/src/main/resources/META-INF/orm/SupervisorTaskInfoMapper.xml
rpc-dj-supervisor/src/main/resources/META-INF/orm/SupervisorWarningBaselineConfigMapper.xml
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/remote/DemoRemoteTest.java
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoServiceTest.java
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorWarningBaselineConfigServiceTest.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/SupervisorTaskDTO.java
View file @
6e4b2d3
...
...
@@ -37,12 +37,11 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty
(
notes
=
"在岗标识 0-在岗 1-调休(日报)"
)
private
Integer
onDutyFlag
;
@NotNull
(
groups
=
{
SupervisorTaskInfoRemote
.
SubmitDayTask
.
class
},
message
=
"门店ID不能为空"
)
@ApiModelProperty
(
notes
=
"门店ID"
)
private
Integer
merchantId
;
@NotEmpty
(
groups
=
{
SupervisorTaskInfoRemote
.
SubmitDayTask
.
class
},
message
=
"门店名称不能为空"
)
@ApiModelProperty
(
notes
=
"门店名称"
)
private
String
merchantName
;
...
...
@@ -110,7 +109,7 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty
(
notes
=
"周任务人员列表"
)
private
List
<
SupervisorWeekTaskStaff
>
weekTaskStaffList
;
@NotEmpty
(
groups
=
{
SupervisorTaskInfoRemote
.
Submit
DayTask
.
class
,
SupervisorTaskInfoRemote
.
Submit
WeekTask
.
class
},
message
=
"照片图片列表不能为空"
)
@NotEmpty
(
groups
=
{
SupervisorTaskInfoRemote
.
SubmitWeekTask
.
class
},
message
=
"照片图片列表不能为空"
)
@ApiModelProperty
(
notes
=
"照片图片列表"
)
private
List
<
SupervisorTaskImage
>
taskImageList
;
...
...
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/SupervisorTaskSummaryDTO.java
View file @
6e4b2d3
...
...
@@ -13,7 +13,7 @@ public class SupervisorTaskSummaryDTO implements Serializable {
/**
* 总人数
*/
@ApiModelProperty
(
notes
=
"总人数"
)
@ApiModelProperty
(
notes
=
"
督导
总人数"
)
private
Integer
totalCount
;
/**
...
...
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoService.java
View file @
6e4b2d3
...
...
@@ -145,31 +145,18 @@ public class SupervisorTaskInfoService {
summary
.
setTotalCount
(
0
);
summary
.
setManagedStoreCount
(
0
);
summary
.
setMonthlyOutput
(
java
.
math
.
BigDecimal
.
ZERO
);
// 1. 查询全部督导列表
//查询在职督导总人数
List
<
MerchantStaffResponse
>
supervisorList
=
listAllSupervisors
();
if
(
CollectionUtils
.
isEmpty
(
supervisorList
))
{
log
.
info
(
"督导列表为空,返回默认汇总"
);
return
summary
;
}
List
<
String
>
phoneList
=
supervisorList
.
stream
()
.
map
(
MerchantStaffResponse:
:
getStaffPhone
)
.
filter
(
phone
->
phone
!=
null
&&
!
phone
.
isEmpty
())
.
distinct
()
.
collect
(
Collectors
.
toList
());
// 2. 批量查询北森信息,统计在职人数
int
onlineCount
=
0
;
if
(!
phoneList
.
isEmpty
())
{
List
<
BeiSenEmployeeListResonseDTO
>
beisenList
=
supervisorLearningCenterService
.
listEmployeeInfoByStaffPhone
(
phoneList
);
if
(
beisenList
!=
null
)
{
onlineCount
=
(
int
)
beisenList
.
stream
()
.
filter
(
emp
->
Integer
.
valueOf
(
1
).
equals
(
emp
.
getZzStatus
()))
// 注意这里的值跟数据库中的是反的
.
count
();
}
}
summary
.
setTotalCount
(
onlineCount
);
summary
.
setTotalCount
(
getEffectiveSupervisors
(
phoneList
));
// 3. 查询 director_config 表,统计所有督导负责的门店(director_type=6,平台中飞行督导)
List
<
Integer
>
merchantIdList
=
supervisorTaskInfoMapper
.
queryMerchantBySupervisorPhone
(
phoneList
);
...
...
@@ -185,6 +172,25 @@ public class SupervisorTaskInfoService {
}
/**
* 查询在职督导总人数
* @return
*/
public
int
getEffectiveSupervisors
(
List
<
String
>
phoneList
)
{
// 1. 查询全部督导列表
int
onlineCount
=
0
;
// 2. 批量查询北森信息,统计在职人数
if
(!
phoneList
.
isEmpty
())
{
List
<
BeiSenEmployeeListResonseDTO
>
beisenList
=
supervisorLearningCenterService
.
listEmployeeInfoByStaffPhone
(
phoneList
);
if
(
beisenList
!=
null
)
{
onlineCount
=
(
int
)
beisenList
.
stream
()
.
filter
(
emp
->
Integer
.
valueOf
(
1
).
equals
(
emp
.
getZzStatus
()))
// 注意这里的值跟数据库中的是反的
.
count
();
}
}
return
onlineCount
;
}
/**
* 查询所有飞行督导人员
* @return
*/
...
...
@@ -306,7 +312,12 @@ public class SupervisorTaskInfoService {
//查询所有飞行督导员工列表
List
<
MerchantStaffResponse
>
merchantStaffResponses
=
listAllSupervisors
();
if
(
CollectionUtils
.
isNotEmpty
(
merchantStaffResponses
))
{
res
.
setTotalCount
(
merchantStaffResponses
.
size
());
List
<
String
>
phoneList
=
merchantStaffResponses
.
stream
()
.
map
(
MerchantStaffResponse:
:
getStaffPhone
)
.
filter
(
phone
->
phone
!=
null
&&
!
phone
.
isEmpty
())
.
distinct
()
.
collect
(
Collectors
.
toList
());
res
.
setTotalCount
(
getEffectiveSupervisors
(
phoneList
));
}
//根据条件,调用分页查询任务 接口,根据返回的数据,去重计算提交任务人数,提交任务数
List
<
SupervisorTaskDTO
>
taskList
=
supervisorTaskInfoMapper
.
listTask
(
request
);
...
...
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorWarningBaselineConfigService.java
View file @
6e4b2d3
...
...
@@ -40,6 +40,7 @@ public class SupervisorWarningBaselineConfigService {
// 新增
config
.
getConfigList
().
stream
().
forEach
(
item
->
{
item
.
setIndicatorCode
(
config
.
getIndicatorCode
());
item
.
setIndicatorName
(
config
.
getIndicatorName
());
item
.
setTimeDimension
(
config
.
getTimeDimension
());
item
.
setDeletedFlag
(
BaseModel
.
DeletedFlagEnum
.
N
.
name
());
item
.
setCreatedBy
(
config
.
getUpdatedBy
());
...
...
@@ -77,7 +78,7 @@ public class SupervisorWarningBaselineConfigService {
}
criteria
.
andEqualTo
(
"deletedFlag"
,
BaseModel
.
DeletedFlagEnum
.
N
.
name
());
//根据更新时间降序
example
.
setOrderByClause
(
"updated
D
ate desc"
);
example
.
setOrderByClause
(
"updated
_d
ate desc"
);
return
supervisorWarningBaselineConfigMapper
.
selectByExample
(
example
);
}
...
...
rpc-dj-supervisor/src/main/resources/META-INF/orm/SupervisorTaskInfoMapper.xml
View file @
6e4b2d3
...
...
@@ -100,6 +100,9 @@
<if
test=
"taskStatus != null"
>
and sti.task_status = #{taskStatus}
</if>
<if
test=
"updatedBy != null and updatedBy != ''"
>
and sti.updated_by like concat('%', #{updatedBy}, '%')
</if>
</where>
order by sti.task_status asc, sti.create_time desc
</select>
...
...
rpc-dj-supervisor/src/main/resources/META-INF/orm/SupervisorWarningBaselineConfigMapper.xml
View file @
6e4b2d3
...
...
@@ -27,7 +27,7 @@
</sql>
<update
id=
"batchUpdate"
>
UPDATE
t
_warning_baseline_config
UPDATE
supervisor
_warning_baseline_config
SET
min_value = CASE
<foreach
collection=
"list"
item=
"item"
separator=
""
>
...
...
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/remote/DemoRemoteTest.java
View file @
6e4b2d3
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
remote
;
import
cn.com.glsx.dj.supervisor.mapper.PersonEfficiencyMapper
;
import
cn.com.glsx.dj.riskmanage.model.DemoModel
;
import
cn.com.glsx.dj.supervisor.remote.sem.PersonEfficiencyRemoteImpl
;
import
cn.com.glsx.dj.supervisor.service.DemoService
;
import
cn.com.glsx.dj.supervisor.service.PersonEfficiencyService
;
import
cn.com.glsx.dj.supervisor.service.ProductEfficiencyService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboReference
;
import
org.junit.Test
;
//import org.oreframework.util.http.HttpUtil;
import
org.springframework.beans.factory.annotation.Autowired
;
//import java.text.ParseException;
//import java.text.SimpleDateFormat;
//import java.util.Date;
/**
* @Title: DemoRemoteTest.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Slf4j
public
class
DemoRemoteTest
extends
BaseRemoteTest
{
//package cn.com.glsx.dj.supervisor.remote;
//
//import cn.com.glsx.dj.supervisor.mapper.PersonEfficiencyMapper;
//import cn.com.glsx.dj.riskmanage.model.DemoModel;
//import cn.com.glsx.dj.supervisor.remote.sem.PersonEfficiencyRemoteImpl;
//import cn.com.glsx.dj.supervisor.service.DemoService;
//import cn.com.glsx.dj.supervisor.service.PersonEfficiencyService;
//import cn.com.glsx.dj.supervisor.service.ProductEfficiencyService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.dubbo.config.annotation.DubboReference;
//import org.junit.Test;
////import org.oreframework.util.http.HttpUtil;
//
//import org.springframework.beans.factory.annotation.Autowired;
//
////import java.text.ParseException;
////import java.text.SimpleDateFormat;
////import java.util.Date;
//
//
///**
// * @Title: DemoRemoteTest.java
// * @Description:
// * @author deployer name
// * @version V1.0
// * @Company: Didihu.com.cn
// * @Copyright Copyright (c) 2017
// */
//@Slf4j
//public class DemoRemoteTest extends BaseRemoteTest{
//// @Autowired
//// private RestTemplate restTemplate;
// @DubboReference
// private DemoRemote demoRemote;
//// @Autowired
//// private Environment env;
// @Autowired
// private RestTemplate restTemplate;
@DubboReference
private
DemoRemote
demoRemote
;
// private DemoService service;
// @Autowired
// private Environment env;
@Autowired
private
DemoService
service
;
@Autowired
private
PersonEfficiencyRemoteImpl
personEfficiencyRemote
;
@Autowired
private
PersonEfficiencyService
personEfficiencyService
;
@Autowired
private
ProductEfficiencyService
productEfficiencyService
;
@Autowired
private
PersonEfficiencyMapper
personEfficiencyMapper
;
// @Test
// public void testSayHello(){
// String result = demoRemote.sayHello("Jerry");
// System.out.println(result);
// }
//
//
// private PersonEfficiencyRemoteImpl personEfficiencyRemote;
// @Autowired
// private PersonEfficiencyService personEfficiencyService;
//
@Test
public
void
load
(){
DemoModel
model
=
demoRemote
.
get
(
"name"
);
System
.
out
.
println
(
model
.
getName
());
}
// @Test
// public void testSayHello(){
// System.out.println("Jerry");
// }
// @Test
// public void test(){
// String configValue = OrePropertyConfigurer.getString("ore.redis.hostName");
// String scan = OrePropertyConfigurer.getString("ore.dubbo.scan");
// String address = OrePropertyConfigurer.getString("ore.dubbo.registry.address");
//// String baseurl = OrePropertyConfigurer.getString("syncQwClockInData.url");
// System.out.println(configValue);
// System.out.println(scan);
// System.out.println(address);
//// System.out.println(baseurl);
// @Autowired
// private ProductEfficiencyService productEfficiencyService;
//
// @Autowired
// private PersonEfficiencyMapper personEfficiencyMapper;
//
// }
//// @Test
//// public void testSayHello(){
//// String result = demoRemote.sayHello("Jerry");
//// System.out.println(result);
//// }
////
////
////
// @Test
// public void test01(){
// String sql="select staff_id,staff_name, statdate,output,ordernum,output/ordernum as atv ,ifnull(ordernum/chuke_total,ordernum/total_ordernum)zhuanhuanlv\n" +
// "from dj_riskmanage_staff_outputanalysis";
// System.out.println(sql);
// List<Map> mapList = personEfficiencyMapper.sqlBySelf(sql);
// for (Map map : mapList) {
// System.out.println(String.valueOf(map.get("staff_name")));
// }
//
// public void load(){
// DemoModel model = demoRemote.get("name");
// System.out.println(model.getName());
// }
// @Test
// public void bitest(){
//
// List<BIQueryMerRankingResponse> list =
// service.queryMerRanking(MerRankingBusinessTypeEnum.QUANYI, MerRankingQueryTypeEnum.WEEK, "2024-10-01",
// "2024-10-31", null, null);
//
// if (CollectionUtils.isEmpty(list)) {
// log.info("没有二级预警的延保门店");
// return;
// }else {
// for (BIQueryMerRankingResponse biQueryMerRankingResponse : list) {
// System.out.println(biQueryMerRankingResponse.getMerchantid()+","+biQueryMerRankingResponse.getMerchantname()+","+biQueryMerRankingResponse.getExceptionnum()+","+biQueryMerRankingResponse.getDetails());
// }
// }
// long storeNum = list.stream().filter(Objects::nonNull).map(BIQueryMerRankingResponse::getMerchantid).distinct().count();
// log.info("sendBIStoreExtendedWarrantyLevel2Warning, storeNum:{}", storeNum);
//// System.out.println(list);
//
// }
//
//
//
//
// @Test
// public void queryStaffBaseInfo() throws ParseException {
//
// String startString = "2024-04-12";
// String endString = "2024-10-19";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Date startDate = sdf.parse(startString);
// Date endDate = sdf.parse(endString);
//
// PersonEffciencyDTO dto = new PersonEffciencyDTO();
// dto.setMerchantId("44212556");
// dto.setStartDate(startDate);
// dto.setEndDate(endDate);
//// dto.setPackageIds("M230613140258333");
// dto.setBusinessType(4);
//
//// List<String> staffs=new ArrayList<>();
//// staffs.add("42812613fefd431bb6fe5741eab699c0");
//
//// dto.setStaffIds("42812613fefd431bb6fe5741eab699c0,fd4351e86fa14ed686bae504b19a61ca");
// RpcResponse<List<PersonEfficiencyVO>> listRpcResponse = personEfficiencyRemote.queryStaffBaseInfo(dto);
// System.out.println(listRpcResponse.getMessage());
// System.out.println(listRpcResponse);
//
//
////// List<PersonEfficiencyVO> list =
//// for (PersonEfficiencyVO personEfficiencyVO : list) {
//// System.out.println(personEfficiencyVO.getStaffid());
//// System.out.println(personEfficiencyVO.getStaffName());
//// System.out.println(personEfficiencyVO.getEntryTime());
//// System.out.println(personEfficiencyVO.getIsNewemployee());
//// System.out.println(personEfficiencyVO.getOutput());
//// System.out.println(personEfficiencyVO.getAtv());
//// System.out.println(personEfficiencyVO.getOrdernum());
//// System.out.println(personEfficiencyVO.getZhuanhuanlv());
//// System.out.println(personEfficiencyVO.getOutputhb());
//// System.out.println("============================");
//// @Test
//// public void testSayHello(){
//// System.out.println("Jerry");
//// }
//
//// @Test
//// public void test(){
//// String configValue = OrePropertyConfigurer.getString("ore.redis.hostName");
//// String scan = OrePropertyConfigurer.getString("ore.dubbo.scan");
//// String address = OrePropertyConfigurer.getString("ore.dubbo.registry.address");
////// String baseurl = OrePropertyConfigurer.getString("syncQwClockInData.url");
//// System.out.println(configValue);
//// System.out.println(scan);
//// System.out.println(address);
////// System.out.println(baseurl);
////
////
//// }
//// @Test
//// public void test01(){
//// String sql="select staff_id,staff_name, statdate,output,ordernum,output/ordernum as atv ,ifnull(ordernum/chuke_total,ordernum/total_ordernum)zhuanhuanlv\n" +
//// "from dj_riskmanage_staff_outputanalysis";
//// System.out.println(sql);
//// List<Map> mapList = personEfficiencyMapper.sqlBySelf(sql);
//// for (Map map : mapList) {
//// System.out.println(String.valueOf(map.get("staff_name")));
//// }
//
//// System.out.println(baseurl);
//
//
// }
////
////import java.io.BufferedReader;
////import java.io.IOException;
////import java.io.InputStreamReader;
////import java.io.OutputStream;
////import java.net.HttpURLConnection;
////import java.net.URL;
////import java.nio.charset.StandardCharsets;
// @Test
// public void queryDataPost(){
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
// String baseUrl = OrePropertyConfigurer.getString("queryData.baseUrl");
// System.out.println("baseUrl="+baseUrl);
//// String url = "http://192.168.2.150:8021/data";
// String requestBody = "{\"biz\": null,\"endDate\": \"2024-12-31\",\"itemCodes\": \"A001,A002,A003,A004,A005\",\"merchantIds\": \"44212814\",\"productCodes\": \"-\",\"series\": \"-\",\"staffIds\": \"c7d297b64ce44e589c912dc811312f5c\",\"staffPhones\": \"-\",\"startDate\": \"2024-10-01\",\"step\": 10}";
//
// try {
// URL obj = new URL(baseUrl);
// HttpURLConnection con = (HttpURLConnection) obj.openConnection();
// con.setRequestMethod("POST");
// con.setRequestProperty("Content-Type", "application/json");
// con.setDoOutput(true);
//
// try (OutputStream os = con.getOutputStream()) {
// byte[] input = requestBody.getBytes(StandardCharsets.UTF_8);
// os.write(input, 0, input.length);
// }
//
// int responseCode = con.getResponseCode();
// System.out.println("Response Code : " + responseCode);
//
// if (responseCode == HttpURLConnection.HTTP_OK) {
// try (BufferedReader in = new BufferedReader(
// new InputStreamReader(con.getInputStream()))) {
// String inputLine;
// StringBuilder response = new StringBuilder();
// while ((inputLine = in.readLine())!= null) {
// response.append(inputLine);
// }
// System.out.println("Response Body: " + response.toString());
// }
// } else {
// System.out.println("POST request not worked");
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
//
//
// }
//
//
//
// @Test
// public void queryDataPost02(){
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
// String baseUrl = OrePropertyConfigurer.getString("queryData.baseUrl");
//
// RequestData requestData = new RequestData();
// requestData.setBiz(null);
// requestData.setEndDate("2024-12-31");
// requestData.setItemCodes("A001,A002,A003,A004,A005");
// requestData.setMerchantIds("44212814");
// requestData.setProductCodes("-");
// requestData.setSeries("-");
// requestData.setStaffIds("c7d297b64ce44e589c912dc811312f5c");
// requestData.setStaffPhones("-");
// requestData.setStartDate("2024-10-01");
// requestData.setStep(10);
//
// ObjectMapper mapper = new ObjectMapper();
// String requestBody;
// try {
// requestBody = mapper.writeValueAsString(requestData);
//
// CloseableHttpClient client = HttpClients.createDefault();
// HttpPost post = new HttpPost(baseUrl);
//
// // 设置请求头
// post.setHeader("Content-Type", "application/json");
// // 设置请求体
// post.setEntity(new StringEntity(requestBody));
//
// HttpResponse response = client.execute(post);
// int statusCode = response.getStatusLine().getStatusCode();
// System.out.println("Response Code: " + statusCode);
//
// String responseBody = EntityUtils.toString(response.getEntity());
// System.out.println("Response Body : " + responseBody);
//
//
//// JsonObject jsonObject = JsonParser.parseString(responseBody).getAsJsonObject();
//// JsonArray contentArray = jsonObject.getAsJsonArray("content");
////
//// Gson gson = new Gson();
//// for (int i = 0; i < contentArray.size(); i++) {
//// JsonObject item = contentArray.get(i).getAsJsonObject();
//// ApiData data = gson.fromJson(item, ApiData.class);
//// System.out.println("================"+data.getItemCode()+","+data.getItemValue()+","+data.getStaffName());
//// }
//// @Test
//// public void bitest(){
////
//// List<BIQueryMerRankingResponse> list =
//// service.queryMerRanking(MerRankingBusinessTypeEnum.QUANYI, MerRankingQueryTypeEnum.WEEK, "2024-10-01",
//// "2024-10-31", null, null);
////
//// if (CollectionUtils.isEmpty(list)) {
//// log.info("没有二级预警的延保门店");
//// return;
//// }else {
//// for (BIQueryMerRankingResponse biQueryMerRankingResponse : list) {
//// System.out.println(biQueryMerRankingResponse.getMerchantid()+","+biQueryMerRankingResponse.getMerchantname()+","+biQueryMerRankingResponse.getExceptionnum()+","+biQueryMerRankingResponse.getDetails());
//// }
//
//
//
//
// client.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
//
// }
//
//
//
// @Autowired
// private RestTemplate restTemplate;
// private static CloseableHttpClient httpClient = null;
//
// @Test
// public void testQueryDataApi() {
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
// String baseUrl = "http://192.168.2.150:8021/data";
// HttpPost httpPost = new HttpPost(baseUrl);
//
// if (null == httpClient) {
// httpClient = HttpClientBuilder.create().build();
// }
// JSONObject json =new JSONObject();
// json.put("biz", null);
// json.put("endDate", "2024-12-31");
// json.put("itemCodes", "A001,A002,A003,A004,A005");
// json.put("merchantIds", "44212814");
// json.put("productCodes", "-");
// json.put("series", "-");
// json.put("staffIds", "-");
// json.put("staffPhones", "-");
// json.put("startDate", "2024-08-01");
// json.put("step", 10);
// try {
// StringEntity se = new StringEntity(json.toString());
// se.setContentEncoding("UTF-8");
// //发送json数据需要设置contentType
// se.setContentType("application/json");
// System.out.println(se.getContent());
// //设置请求参数
// httpPost.setEntity(se);
// HttpResponse response = httpClient.execute(httpPost);
// log.info("response:{}", response.getEntity());
//
// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
// //返回json格式
// String res = EntityUtils.toString(response.getEntity());
// log.info("res:{}", res);
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println("res="+res);
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println();
// }
//
// } catch (IOException e) {
// e.printStackTrace();
// } finally {
// if (httpClient != null) {
// try {
// httpClient.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }
//
//
//// }
//// long storeNum = list.stream().filter(Objects::nonNull).map(BIQueryMerRankingResponse::getMerchantid).distinct().count();
//// log.info("sendBIStoreExtendedWarrantyLevel2Warning, storeNum:{}", storeNum);
////// System.out.println(list);
////
//// }
////
////
////
////
//// @Test
//// public void queryStaffBaseInfo() throws ParseException {
////
//// String startString = "2024-04-12";
//// String endString = "2024-10-19";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date startDate = sdf.parse(startString);
//// Date endDate = sdf.parse(endString);
////
//// PersonEffciencyDTO dto = new PersonEffciencyDTO();
//// dto.setMerchantId("44212556");
//// dto.setStartDate(startDate);
//// dto.setEndDate(endDate);
////// dto.setPackageIds("M230613140258333");
//// dto.setBusinessType(4);
////
////// List<String> staffs=new ArrayList<>();
////// staffs.add("42812613fefd431bb6fe5741eab699c0");
////
////// dto.setStaffIds("42812613fefd431bb6fe5741eab699c0,fd4351e86fa14ed686bae504b19a61ca");
//// RpcResponse<List<PersonEfficiencyVO>> listRpcResponse = personEfficiencyRemote.queryStaffBaseInfo(dto);
//// System.out.println(listRpcResponse.getMessage());
//// System.out.println(listRpcResponse);
////
////
//////// List<PersonEfficiencyVO> list =
////// for (PersonEfficiencyVO personEfficiencyVO : list) {
////// System.out.println(personEfficiencyVO.getStaffid());
////// System.out.println(personEfficiencyVO.getStaffName());
////// System.out.println(personEfficiencyVO.getEntryTime());
////// System.out.println(personEfficiencyVO.getIsNewemployee());
////// System.out.println(personEfficiencyVO.getOutput());
////// System.out.println(personEfficiencyVO.getAtv());
////// System.out.println(personEfficiencyVO.getOrdernum());
////// System.out.println(personEfficiencyVO.getZhuanhuanlv());
////// System.out.println(personEfficiencyVO.getOutputhb());
////// System.out.println("============================");
////// }
////
////// System.out.println(baseurl);
////
////
//// }
//////
//////import java.io.BufferedReader;
//////import java.io.IOException;
//////import java.io.InputStreamReader;
//////import java.io.OutputStream;
//////import java.net.HttpURLConnection;
//////import java.net.URL;
//////import java.nio.charset.StandardCharsets;
//// @Test
//// public void queryDataPost(){
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
//// String baseUrl = OrePropertyConfigurer.getString("queryData.baseUrl");
//// System.out.println("baseUrl="+baseUrl);
////// String url = "http://192.168.2.150:8021/data";
//// String requestBody = "{\"biz\": null,\"endDate\": \"2024-12-31\",\"itemCodes\": \"A001,A002,A003,A004,A005\",\"merchantIds\": \"44212814\",\"productCodes\": \"-\",\"series\": \"-\",\"staffIds\": \"c7d297b64ce44e589c912dc811312f5c\",\"staffPhones\": \"-\",\"startDate\": \"2024-10-01\",\"step\": 10}";
////
//// try {
//// URL obj = new URL(baseUrl);
//// HttpURLConnection con = (HttpURLConnection) obj.openConnection();
//// con.setRequestMethod("POST");
//// con.setRequestProperty("Content-Type", "application/json");
//// con.setDoOutput(true);
////
//// try (OutputStream os = con.getOutputStream()) {
//// byte[] input = requestBody.getBytes(StandardCharsets.UTF_8);
//// os.write(input, 0, input.length);
//// }
////
//// int responseCode = con.getResponseCode();
//// System.out.println("Response Code : " + responseCode);
////
//// if (responseCode == HttpURLConnection.HTTP_OK) {
//// try (BufferedReader in = new BufferedReader(
//// new InputStreamReader(con.getInputStream()))) {
//// String inputLine;
//// StringBuilder response = new StringBuilder();
//// while ((inputLine = in.readLine())!= null) {
//// response.append(inputLine);
//// }
//// System.out.println("Response Body: " + response.toString());
//// }
//// } else {
//// System.out.println("POST request not worked");
//// }
//// } catch (IOException e) {
//// e.printStackTrace();
//// }
////
////
//// }
////
////
////
//// @Test
//// public void queryDataPost02(){
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
//// String baseUrl = OrePropertyConfigurer.getString("queryData.baseUrl");
////
//// RequestData requestData = new RequestData();
//// requestData.setBiz(null);
//// requestData.setEndDate("2024-12-31");
//// requestData.setItemCodes("A001,A002,A003,A004,A005");
//// requestData.setMerchantIds("44212814");
//// requestData.setProductCodes("-");
//// requestData.setSeries("-");
//// requestData.setStaffIds("c7d297b64ce44e589c912dc811312f5c");
//// requestData.setStaffPhones("-");
//// requestData.setStartDate("2024-10-01");
//// requestData.setStep(10);
////
//// ObjectMapper mapper = new ObjectMapper();
//// String requestBody;
//// try {
//// requestBody = mapper.writeValueAsString(requestData);
////
//// CloseableHttpClient client = HttpClients.createDefault();
//// HttpPost post = new HttpPost(baseUrl);
////
//// // 设置请求头
//// post.setHeader("Content-Type", "application/json");
//// // 设置请求体
//// post.setEntity(new StringEntity(requestBody));
////
//// HttpResponse response = client.execute(post);
//// int statusCode = response.getStatusLine().getStatusCode();
//// System.out.println("Response Code: " + statusCode);
////
//// String responseBody = EntityUtils.toString(response.getEntity());
//// System.out.println("Response Body : " + responseBody);
////
////
////// JsonObject jsonObject = JsonParser.parseString(responseBody).getAsJsonObject();
////// JsonArray contentArray = jsonObject.getAsJsonArray("content");
//////
////// Gson gson = new Gson();
////// for (int i = 0; i < contentArray.size(); i++) {
////// JsonObject item = contentArray.get(i).getAsJsonObject();
////// ApiData data = gson.fromJson(item, ApiData.class);
////// System.out.println("================"+data.getItemCode()+","+data.getItemValue()+","+data.getStaffName());
////// }
////
////
////
////
//// client.close();
//// } catch (IOException e) {
//// e.printStackTrace();
//// }
////
//// }
////
////
////
//// @Autowired
//// private RestTemplate restTemplate;
//// private static CloseableHttpClient httpClient = null;
////
//// @Test
//// public void testQueryDataApi() {
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
//// String baseUrl = "http://192.168.2.150:8021/data";
//// HttpPost httpPost = new HttpPost(baseUrl);
////
//// if (null == httpClient) {
//// httpClient = HttpClientBuilder.create().build();
//// }
//// JSONObject json =new JSONObject();
//// json.put("biz", null);
//// json.put("endDate", "2024-12-31");
//// json.put("itemCodes", "A001,A002,A003,A004,A005");
//// json.put("merchantIds", "44212814");
//// json.put("productCodes", "-");
//// json.put("series", "-");
//// json.put("staffIds", "-");
//// json.put("staffPhones", "-");
//// json.put("startDate", "2024-08-01");
//// json.put("step", 10);
//// try {
//// StringEntity se = new StringEntity(json.toString());
//// se.setContentEncoding("UTF-8");
//// //发送json数据需要设置contentType
//// se.setContentType("application/json");
//// System.out.println(se.getContent());
//// //设置请求参数
//// httpPost.setEntity(se);
//// HttpResponse response = httpClient.execute(httpPost);
//// log.info("response:{}", response.getEntity());
////
//// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
//// //返回json格式
//// String res = EntityUtils.toString(response.getEntity());
//// log.info("res:{}", res);
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println("res="+res);
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// }
////
//// } catch (IOException e) {
//// e.printStackTrace();
//// } finally {
//// if (httpClient != null) {
//// try {
//// httpClient.close();
//// } catch (IOException e) {
//// e.printStackTrace();
//// }
//// }
//// }
////
////
////// System.out.println("baseUrl="+baseUrl);
//////
////// UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(baseUrl)
////// .queryParam("biz", null)
////// .queryParam("endDate", "2024-12-31")
////// .queryParam("itemCodes", "A001,A002,A003,A004,A005")
////// .queryParam("merchantIds", "44212814")
////// .queryParam("productCodes", "-")
////// .queryParam("series", "-")
////// .queryParam("staffIds", "-")
////// .queryParam("staffPhones", "-")
////// .queryParam("startDate", "2024-08-01")
////// .queryParam("step", 10);
////// String request = builder.toUriString();
////// log.info("bi queryMerRanking request:{}", request);
//////
////// String response = restTemplate.getForObject(request, String.class);
////// System.out.println(response);
//////
////// JSONObject responseJson = JSONObject.parseObject(response);
////// if (!"0".equals(responseJson.get("code"))) {
////// throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "请求BI查询预警门店失败");
////// }
////// List<BIQueryMerRankingResponse> list = JSONArray.parseArray(responseJson.getJSONObject("data").getString("list"), BIQueryMerRankingResponse.class);
//////
//// }
////
////
////
//// @Test
//// public void testQueryDataApi02() {
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
//// String baseUrl = "http://192.168.2.150:8021";
////
//// System.out.println("baseUrl="+baseUrl);
////
//// UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(baseUrl)
//// .queryParam("biz", null)
//// .queryParam("endDate", "2024-12-31")
//// .queryParam("itemCodes", "A001,A002,A003,A004,A005")
//// .queryParam("merchantIds", "44212814")
//// .queryParam("productCodes", "-")
//// .queryParam("series", "-")
//// .queryParam("staffIds", "-")
//// .queryParam("staffPhones", "-")
//// .queryParam("startDate", "2024-08-01")
//// .queryParam("step", 10);
//// // 构建基础的URI
//// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl);
////
//// String request = builder.toUriString();
//// log.info("bi queryMerRanking request:{}", request);
////
//// String response = restTemplate.getForObject(request, String.class);
////// // 添加路径部分
//// builder.path("/data");
////
//// // 构建出最终的URI对象
//// URI uri = builder.build().toUri();
////
//// // 创建请求头,设置内容类型为JSON
//// HttpHeaders headers = new HttpHeaders();
//// headers.setContentType(MediaType.APPLICATION_JSON);
////
//// // 构建请求体数据(这里简单示例,实际按业务构造)
//// com.alibaba.fastjson.JSONObject requestBody = new com.alibaba.fastjson.JSONObject();
//// requestBody.put("biz", null);
//// requestBody.put("endDate", "2024-12-31");
//// requestBody.put("itemCodes", "A001,A002,A003,A004,A005");
//// requestBody.put("merchantIds", "44212814");
//// requestBody.put("productCodes", "-");
//// requestBody.put("series", "-");
//// requestBody.put("staffIds", "-");
//// requestBody.put("staffPhones", "-");
//// requestBody.put("startDate", "2024-08-01");
//// requestBody.put("step", 10);
////
//// // 将请求体和请求头封装成HttpEntity
//// HttpEntity<String> entity = new HttpEntity<>(requestBody.toString(), headers);
////
//// // 使用RestTemplate发送POST请求
//// RestTemplate restTemplate = new RestTemplate();
//// String response = restTemplate.postForObject(uri, entity, String.class);
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println(response);
//// //<ReturnT><code>200</code><msg/><content><id/><rowkey/><itemCode>A001</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>683.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content><content><id/><rowkey/><itemCode>A002</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>227.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content><content><id/><rowkey/><itemCode>A003</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>32.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content><content><id/><rowkey/><itemCode>A004</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>258.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content></ReturnT>
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println();
////
//// JSONObject responseJson = JSONObject.parseObject(response);
//// if (!"0".equals(responseJson.get("code"))) {
//// throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "请求BI查询预警门店失败");
//// }
//// List<BIQueryMerRankingResponse> list = JSONArray.parseArray(responseJson.getJSONObject("data").getString("list"), BIQueryMerRankingResponse.class);
//// }
////
// }
//
//
//
// @Test
// public void testQueryDataApi02() {
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
// String baseUrl = "http://192.168.2.150:8021";
//
// System.out.println("baseUrl="+baseUrl);
//
// // 构建基础的URI
// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl);
//
// String request = builder.toUriString();
// log.info("bi queryMerRanking request:{}", request);
//
//// // 添加路径部分
// builder.path("/data");
//
// // 构建出最终的URI对象
// URI uri = builder.build().toUri();
//
// // 创建请求头,设置内容类型为JSON
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON);
//
// // 构建请求体数据(这里简单示例,实际按业务构造)
// com.alibaba.fastjson.JSONObject requestBody = new com.alibaba.fastjson.JSONObject();
// requestBody.put("biz", null);
// requestBody.put("endDate", "2024-12-31");
// requestBody.put("itemCodes", "A001,A002,A003,A004,A005");
// requestBody.put("merchantIds", "44212814");
// requestBody.put("productCodes", "-");
// requestBody.put("series", "-");
// requestBody.put("staffIds", "-");
// requestBody.put("staffPhones", "-");
// requestBody.put("startDate", "2024-08-01");
// requestBody.put("step", 10);
//
// // 将请求体和请求头封装成HttpEntity
// HttpEntity<String> entity = new HttpEntity<>(requestBody.toString(), headers);
//
// // 使用RestTemplate发送POST请求
// RestTemplate restTemplate = new RestTemplate();
// String response = restTemplate.postForObject(uri, entity, String.class);
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println(response);
// //<ReturnT><code>200</code><msg/><content><id/><rowkey/><itemCode>A001</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>683.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content><content><id/><rowkey/><itemCode>A002</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>227.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content><content><id/><rowkey/><itemCode>A003</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>32.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content><content><id/><rowkey/><itemCode>A004</itemCode><date>2024-12-31</date><merchantId>44212814</merchantId><merchantName>银川华为1.</merchantName><staffId>-</staffId><staffName>-</staffName><staffPhone/><biz/><productId>-</productId><productName/><series>-</series><itemValue>258.0000</itemValue><createTime/><preValue/><startDate>2024-09-01</startDate><endDate>2024-12-15</endDate><rate/></content></ReturnT>
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println();
//
// }
//
// @Test
// public void testQueryDataApi03() throws Exception{
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
// String baseUrl = "http://192.168.2.150:8021";
//
// System.out.println("baseUrl="+baseUrl);
//
//
//
//
//
// // 构建基础的URI(类似前面Spring方式构建)
// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl);
// builder.path("/data");
// URI uri = builder.build().toUri();
//
// // 创建HttpClient对象
// HttpClient httpClient = HttpClientBuilder.create().build();
//
// // 创建HttpPost请求对象,设置请求的URI
// HttpPost httpPost = new HttpPost(uri);
//
// // 设置请求头(设置Content-Type等)
// httpPost.setHeader("Content-Type", "application/json");
//
// // 构建请求体数据
// JSONObject requestBody = new JSONObject();
// requestBody.put("username", "testuser");
// requestBody.put("password", "testpassword");
// requestBody.put("biz", null);
// requestBody.put("endDate", "2024-12-31");
// requestBody.put("itemCodes", "A001,A002,A003,A004,A005");
// requestBody.put("merchantIds", "44212814");
// requestBody.put("productCodes", "-");
// requestBody.put("series", "-");
// requestBody.put("staffIds", "-");
// requestBody.put("staffPhones", "-");
// requestBody.put("startDate", "2024-08-01");
// requestBody.put("step", 10);
// // 将请求体数据封装到StringEntity中,设置编码等
// StringEntity entity = new StringEntity(requestBody.toString(), "UTF-8");
// httpPost.setEntity(entity);
// // 发送请求,获取响应
// HttpResponse response = httpClient.execute(httpPost);
// // 处理响应,获取响应内容(这里简单打印)
// org.apache.http.HttpEntity responseEntity = response.getEntity();
//// HttpEntity responseEntity = response.getEntity();
//
// String responseString = EntityUtils.toString(responseEntity);
//// System.out.println("Response: " + responseString);
//
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println(responseString);
// //{"code":200,"msg":null,"content":[{"id":null,"rowkey":null,"itemCode":"A001","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":683.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null},{"id":null,"rowkey":null,"itemCode":"A002","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":227.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null},{"id":null,"rowkey":null,"itemCode":"A003","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":32.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null},{"id":null,"rowkey":null,"itemCode":"A004","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":258.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null}]}
// System.out.println();
// System.out.println();
// System.out.println();
// System.out.println();
//
// }
//
//
//
//
//
//
// @Test
// public void queryStaffTrend() throws ParseException {
// PersonEffciencyTrendDTO dto = new PersonEffciencyTrendDTO();
////按日
// String startString = "2024-10-12";
// String endString = "2024-10-19";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Date startDate = sdf.parse(startString);
// Date endDate = sdf.parse(endString);
// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
// dto.setStartDate(startDate);
// dto.setEndDate(endDate);
//// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率
// dto.setMerchantId("44212556");
//
//
//
//// 按年
//// String startString = "2024-01-01";
//// String endString = "2024-12-31";
//// @Test
//// public void testQueryDataApi03() throws Exception{
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking");
////// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl");
//// String baseUrl = "http://192.168.2.150:8021";
////
//// System.out.println("baseUrl="+baseUrl);
////
////
////
////
////
//// // 构建基础的URI(类似前面Spring方式构建)
//// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl);
//// builder.path("/data");
//// URI uri = builder.build().toUri();
////
//// // 创建HttpClient对象
//// HttpClient httpClient = HttpClientBuilder.create().build();
////
//// // 创建HttpPost请求对象,设置请求的URI
//// HttpPost httpPost = new HttpPost(uri);
////
//// // 设置请求头(设置Content-Type等)
//// httpPost.setHeader("Content-Type", "application/json");
////
//// // 构建请求体数据
//// JSONObject requestBody = new JSONObject();
//// requestBody.put("username", "testuser");
//// requestBody.put("password", "testpassword");
//// requestBody.put("biz", null);
//// requestBody.put("endDate", "2024-12-31");
//// requestBody.put("itemCodes", "A001,A002,A003,A004,A005");
//// requestBody.put("merchantIds", "44212814");
//// requestBody.put("productCodes", "-");
//// requestBody.put("series", "-");
//// requestBody.put("staffIds", "-");
//// requestBody.put("staffPhones", "-");
//// requestBody.put("startDate", "2024-08-01");
//// requestBody.put("step", 10);
//// // 将请求体数据封装到StringEntity中,设置编码等
//// StringEntity entity = new StringEntity(requestBody.toString(), "UTF-8");
//// httpPost.setEntity(entity);
//// // 发送请求,获取响应
//// HttpResponse response = httpClient.execute(httpPost);
//// // 处理响应,获取响应内容(这里简单打印)
//// org.apache.http.HttpEntity responseEntity = response.getEntity();
////// HttpEntity responseEntity = response.getEntity();
////
//// String responseString = EntityUtils.toString(responseEntity);
////// System.out.println("Response: " + responseString);
////
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println(responseString);
//// //{"code":200,"msg":null,"content":[{"id":null,"rowkey":null,"itemCode":"A001","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":683.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null},{"id":null,"rowkey":null,"itemCode":"A002","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":227.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null},{"id":null,"rowkey":null,"itemCode":"A003","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":32.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null},{"id":null,"rowkey":null,"itemCode":"A004","date":"2024-12-31","merchantId":"44212814","merchantName":"银川华为1.","staffId":"-","staffName":"-","staffPhone":null,"biz":null,"productId":"-","productName":null,"series":"-","itemValue":258.0000,"createTime":null,"preValue":null,"startDate":"2024-09-01","endDate":"2024-12-15","rate":null}]}
//// System.out.println();
//// System.out.println();
//// System.out.println();
//// System.out.println();
////
//// }
////
////
////
////
////
////
//// @Test
//// public void queryStaffTrend() throws ParseException {
//// PersonEffciencyTrendDTO dto = new PersonEffciencyTrendDTO();
//////按日
//// String startString = "2024-10-12";
//// String endString = "2024-10-19";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date startDate = sdf.parse(startString);
//// Date endDate = sdf.parse(endString);
//// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
//// dto.setStartDate(startDate);
//// dto.setEndDate(endDate);
//// dto.setAllYear(true);
////// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率
//// dto.setMerchantId("44212556");
//
//
//
//// List<String> staffids=new ArrayList<>();
//// //
//// staffids.add("0ab752fe72474710a99c5d04a31217b7");
//// staffids.add("f6688827a4a24eafa97cafb5a30fd963");
//// staffids.add("e385f86a56394cf7af1b9d0de9f9b173");
//// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
//// dto.setStaffIds(staffids);
//
//// dto.setStaffIds("0ab752fe72474710a99c5d04a31217b7,f6688827a4a24eafa97cafb5a30fd963,e385f86a56394cf7af1b9d0de9f9b173");
//// dto.setProductIds("M240305154411408");
//
// List<PersonEfficiencyOutputTrendVO> list = personEfficiencyService.queryStaffOutputTrend(dto);
// for (PersonEfficiencyOutputTrendVO vo : list) {
// for (StaffTrendDTO staffTrendDTO : vo.getStaffTrendDTOList()) {
// System.out.println(staffTrendDTO.getStatDate());
// System.out.println(staffTrendDTO.getStaffId());
// System.out.println(staffTrendDTO.getStaffName());
// System.out.println(staffTrendDTO.getStatDate());
// System.out.println(staffTrendDTO.getOutput());
// System.out.println(staffTrendDTO.getAtv());
// System.out.println(staffTrendDTO.getZhuanhuanlv());
// }
// System.out.println("============================");
// }
//
//// System.out.println(baseurl);
//
//
// }
//
// @Test
// public void queryStaffs() throws ParseException {
// PersonEffciencystaffDTO dto = new PersonEffciencystaffDTO();
//
//
// String startString = "2024-04-19";
// String endString = "2024-10-19";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Date startDate = sdf.parse(startString);
// Date endDate = sdf.parse(endString);
// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
// dto.setStartDate(startDate);
// dto.setEndDate(endDate);
// dto.setMerchantId("44212556");
//
//// List<String> staffids=new ArrayList<>();
//// //
//// staffids.add("0ab752fe72474710a99c5d04a31217b7");
//// staffids.add("f6688827a4a24eafa97cafb5a30fd963");
//// staffids.add("e385f86a56394cf7af1b9d0de9f9b173");
//// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
//// dto.setStaffIds(staffids);
//
//
// List<PersonEfficiencystaffVO> list = personEfficiencyService.queryStaffs(dto);
// for (PersonEfficiencystaffVO vo : list) {
// System.out.println(vo.getStaffid());
// System.out.println(vo.getStaffName());
// System.out.println(vo.getMerchantid());
// System.out.println(vo.getBusinessType());
//
// System.out.println("============================");
// }
//
//// System.out.println(baseurl);
//
//
// }
////
// @Test
// public void queryGoodsList() throws ParseException {
// PersonEffciencystaffDTO dto = new PersonEffciencystaffDTO();
//
//
// String startString = "2024-04-19";
// String endString = "2024-10-19";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Date startDate = sdf.parse(startString);
// Date endDate = sdf.parse(endString);
// dto.setBusinessType(4);//2-轻改,3-权益,4-延保
// dto.setStartDate(startDate);
// dto.setEndDate(endDate);
// dto.setMerchantId("44212556");
//
//
// List<PersonEfficiencyGoodsListVO> list = personEfficiencyService.queryGoodsList(dto);
// for (PersonEfficiencyGoodsListVO vo : list) {
// System.out.println(vo.getProductid());
// System.out.println(vo.getProductName());
// System.out.println(vo.getMerchantid());
// System.out.println(vo.getBusinessType());
//
// System.out.println("============================");
// }
//
//// System.out.println(baseurl);
// }
//
// @Test
// public void getStaffEntryTimeByPhone01() throws ParseException {
//
// Map<String, String[]> result = getStaffEntryTimeByPhone();
//// result.forEach((k, v) -> System.out.println("Key: " + k + ", Value: " + v[0] + ", " + v[1]));
//
// System.out.println(">>>>>>>>>>>>");
//
// String[] entrytime = result.get("15688845544");
//
// System.out.println(entrytime);
// System.out.println(entrytime[0].length()<10?entrytime[0]:entrytime[0].substring(0,10));
// System.out.println(Boolean.valueOf(entrytime[1].equals("是")?true:false));
//
//
//
// }
//
//
//
//
// public Map<String, String[]> getStaffEntryTimeByPhone() {
// List<StaffVO> staffVOS = personEfficiencyMapper.selectStaffByPhoneList(new ArrayList<>());
//
// Map<String, String[]> result = staffVOS.stream()
// .collect(Collectors.toMap(
// StaffVO::getStaffPhone,
// vo -> new String[]{vo.getEntryTime(), vo.getIsNewemployee()}
// ));
//
//// result.forEach((k, v) -> System.out.println("Key: " + k + ", Value: " + v[0] + ", " + v[1]));
//
// return result;
//
// }
//
//
// @Test
// public void queryoutputtrend() throws ParseException {
// ProductEffciencyDTO dto = new ProductEffciencyDTO();
//
// String startString = "2024-10-12";
// String endString = "2024-10-19";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Date startDate = sdf.parse(startString);
// Date endDate = sdf.parse(endString);
// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
// dto.setStartDate(startDate);
// dto.setEndDate(endDate);
//// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率
// dto.setMerchantId("44212233");
//// List<String> staffids=new ArrayList<>();
//// staffids.add("a25f73d8073b48a6bf8fa32044f5fd30");
//// staffids.add("b228fc114d9347ff93ca8d6d832249dd");
// dto.setStaffIds("a25f73d8073b48a6bf8fa32044f5fd30,b228fc114d9347ff93ca8d6d832249dd");
//
// List<ProductEfficiencyVO> list = productEfficiencyService.queryoutputtrend(dto);
// for (ProductEfficiencyVO vo : list) {
//
// System.out.println(vo.getProductId());
// System.out.println(vo.getGoodsname());
// System.out.println(vo.getOutput());
// System.out.println(vo.getOrdernum());
// System.out.println(vo.getAtv());
// System.out.println(vo.getBusinessType());
//
// System.out.println("============================");
// }
//
//// System.out.println(baseurl);
//
//
// }
//
// @Test
// public void selectStaffByPhoneList(){
//// select staff_phone,staff_name,entry_time from dj_car_life_staff_base_info where deleted_flag='N'
//// and staff_phone in ('15626599738','12365413214','13022222222')
//
// List<String> staffPhoneList =new ArrayList<>();
// staffPhoneList.add("15626599738");
// staffPhoneList.add("12365413214");
// staffPhoneList.add("13022222222");
// staffPhoneList.add("17875511888");
// List<StaffVO> staffVOS = personEfficiencyMapper.selectStaffByPhoneList(staffPhoneList);
// System.out.println("===============");
// for (StaffVO staffVO : staffVOS) {
// System.out.println(staffVO.getStaffName()+","+staffVO.getStaffPhone()+","+staffVO.getEntryTime()+","+staffVO.getIsNewemployee());
// }
// System.out.println("<<<<<<<<<<<<<<<<<");
////
////
////// 按年
////// String startString = "2024-01-01";
////// String endString = "2024-12-31";
////// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
////// Date startDate = sdf.parse(startString);
////// Date endDate = sdf.parse(endString);
////// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
////// dto.setStartDate(startDate);
////// dto.setEndDate(endDate);
////// dto.setAllYear(true);
//////// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率
////// dto.setMerchantId("44212556");
////
////
////
////// List<String> staffids=new ArrayList<>();
////// //
////// staffids.add("0ab752fe72474710a99c5d04a31217b7");
////// staffids.add("f6688827a4a24eafa97cafb5a30fd963");
////// staffids.add("e385f86a56394cf7af1b9d0de9f9b173");
////// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
////// dto.setStaffIds(staffids);
////
////// dto.setStaffIds("0ab752fe72474710a99c5d04a31217b7,f6688827a4a24eafa97cafb5a30fd963,e385f86a56394cf7af1b9d0de9f9b173");
////// dto.setProductIds("M240305154411408");
////
//// List<PersonEfficiencyOutputTrendVO> list = personEfficiencyService.queryStaffOutputTrend(dto);
//// for (PersonEfficiencyOutputTrendVO vo : list) {
//// for (StaffTrendDTO staffTrendDTO : vo.getStaffTrendDTOList()) {
//// System.out.println(staffTrendDTO.getStatDate());
//// System.out.println(staffTrendDTO.getStaffId());
//// System.out.println(staffTrendDTO.getStaffName());
//// System.out.println(staffTrendDTO.getStatDate());
//// System.out.println(staffTrendDTO.getOutput());
//// System.out.println(staffTrendDTO.getAtv());
//// System.out.println(staffTrendDTO.getZhuanhuanlv());
//// }
//// System.out.println("============================");
//// }
////
////// System.out.println(baseurl);
////
////
//// }
//
////
//// @Test
//// public void queryStaffs() throws ParseException {
//// PersonEffciencystaffDTO dto = new PersonEffciencystaffDTO();
////
////
//// String startString = "2024-04-19";
//// String endString = "2024-10-19";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date startDate = sdf.parse(startString);
//// Date endDate = sdf.parse(endString);
//// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
//// dto.setStartDate(startDate);
//// dto.setEndDate(endDate);
//// dto.setMerchantId("44212556");
////
////// List<String> staffids=new ArrayList<>();
////// //
////// staffids.add("0ab752fe72474710a99c5d04a31217b7");
////// staffids.add("f6688827a4a24eafa97cafb5a30fd963");
////// staffids.add("e385f86a56394cf7af1b9d0de9f9b173");
////// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
////// dto.setStaffIds(staffids);
////
////
//// List<PersonEfficiencystaffVO> list = personEfficiencyService.queryStaffs(dto);
//// for (PersonEfficiencystaffVO vo : list) {
//// System.out.println(vo.getStaffid());
//// System.out.println(vo.getStaffName());
//// System.out.println(vo.getMerchantid());
//// System.out.println(vo.getBusinessType());
////
//// System.out.println("============================");
//// }
////
////// System.out.println(baseurl);
////
////
//// }
//////
//// @Test
//// public void queryGoodsList() throws ParseException {
//// PersonEffciencystaffDTO dto = new PersonEffciencystaffDTO();
////
////
//// String startString = "2024-04-19";
//// String endString = "2024-10-19";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date startDate = sdf.parse(startString);
//// Date endDate = sdf.parse(endString);
//// dto.setBusinessType(4);//2-轻改,3-权益,4-延保
//// dto.setStartDate(startDate);
//// dto.setEndDate(endDate);
//// dto.setMerchantId("44212556");
////
////
//// List<PersonEfficiencyGoodsListVO> list = personEfficiencyService.queryGoodsList(dto);
//// for (PersonEfficiencyGoodsListVO vo : list) {
//// System.out.println(vo.getProductid());
//// System.out.println(vo.getProductName());
//// System.out.println(vo.getMerchantid());
//// System.out.println(vo.getBusinessType());
////
//// System.out.println("============================");
//// }
////
////// System.out.println(baseurl);
//// }
////
//
//// List<Map> mapList = personEfficiencyMapper.sqlBySelf("select staff_phone,staff_name,entry_time from dj_car_life_staff_base_info where deleted_flag='N'\n" +
//// "and staff_phone in ('15626599738','12365413214','13022222222')");
//// @Test
//// public void getStaffEntryTimeByPhone01() throws ParseException {
////
//// Map<String, String[]> result = getStaffEntryTimeByPhone();
////// result.forEach((k, v) -> System.out.println("Key: " + k + ", Value: " + v[0] + ", " + v[1]));
////
//// System.out.println(">>>>>>>>>>>>");
////
//// String[] entrytime = result.get("15688845544");
////
//// System.out.println(entrytime);
//// System.out.println(entrytime[0].length()<10?entrytime[0]:entrytime[0].substring(0,10));
//// System.out.println(Boolean.valueOf(entrytime[1].equals("是")?true:false));
////
////
////
//// }
////
////
////
////
//// public Map<String, String[]> getStaffEntryTimeByPhone() {
//// List<StaffVO> staffVOS = personEfficiencyMapper.selectStaffByPhoneList(new ArrayList<>());
////
//// Map<String, String[]> result = staffVOS.stream()
//// .collect(Collectors.toMap(
//// StaffVO::getStaffPhone,
//// vo -> new String[]{vo.getEntryTime(), vo.getIsNewemployee()}
//// ));
////
////// result.forEach((k, v) -> System.out.println("Key: " + k + ", Value: " + v[0] + ", " + v[1]));
////
//// return result;
////
//// }
////
////
//// @Test
//// public void queryoutputtrend() throws ParseException {
//// ProductEffciencyDTO dto = new ProductEffciencyDTO();
////
//// String startString = "2024-10-12";
//// String endString = "2024-10-19";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date startDate = sdf.parse(startString);
//// Date endDate = sdf.parse(endString);
//// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
//// dto.setStartDate(startDate);
//// dto.setEndDate(endDate);
////// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率
//// dto.setMerchantId("44212233");
////// List<String> staffids=new ArrayList<>();
////// staffids.add("a25f73d8073b48a6bf8fa32044f5fd30");
////// staffids.add("b228fc114d9347ff93ca8d6d832249dd");
//// dto.setStaffIds("a25f73d8073b48a6bf8fa32044f5fd30,b228fc114d9347ff93ca8d6d832249dd");
////
//// List<ProductEfficiencyVO> list = productEfficiencyService.queryoutputtrend(dto);
//// for (ProductEfficiencyVO vo : list) {
////
//// System.out.println(vo.getProductId());
//// System.out.println(vo.getGoodsname());
//// System.out.println(vo.getOutput());
//// System.out.println(vo.getOrdernum());
//// System.out.println(vo.getAtv());
//// System.out.println(vo.getBusinessType());
////
//// System.out.println("============================");
//// }
////
////// System.out.println(baseurl);
////
////
//// }
////
//// @Test
//// public void selectStaffByPhoneList(){
////// select staff_phone,staff_name,entry_time from dj_car_life_staff_base_info where deleted_flag='N'
////// and staff_phone in ('15626599738','12365413214','13022222222')
////
//// List<String> staffPhoneList =new ArrayList<>();
//// staffPhoneList.add("15626599738");
//// staffPhoneList.add("12365413214");
//// staffPhoneList.add("13022222222");
//// staffPhoneList.add("17875511888");
//// List<StaffVO> staffVOS = personEfficiencyMapper.selectStaffByPhoneList(staffPhoneList);
//// System.out.println("===============");
//// for (Map map : mapList) {
//// if(map!=null){
//// System.out.println(map.get("staff_name")+","+map.get("staff_phone")+","+map.get("entry_time"));
//// }
//// for (StaffVO staffVO : staffVOS) {
//// System.out.println(staffVO.getStaffName()+","+staffVO.getStaffPhone()+","+staffVO.getEntryTime()+","+staffVO.getIsNewemployee());
//// }
//// System.out.println("<<<<<<<<<<<<<<<<<");
//
//
// }
//
//
//
// @Test
// public void queryStaffReception() throws ParseException {
// PersonEffciencySatffReceptionDTO dto = new PersonEffciencySatffReceptionDTO();
//
// String startString = "2024-10-12";
// String endString = "2024-10-19";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// Date startDate = sdf.parse(startString);
// Date endDate = sdf.parse(endString);
// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
// dto.setStartDate(startDate);
// dto.setEndDate(endDate);
//// dto.setQueryType(DateType.year);
// dto.setMerchantId("44212556");
// List<String> staffids=new ArrayList<>();
// staffids.add("4f69767e9d1a437fb42437f8de56b5d2");
// staffids.add("6825aaebf4f04f6a8a4c3d5a9b26c914");
// staffids.add("8aab9628ec764fe6b89b4aefe82320e1");
// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
// dto.setStaffIds(staffids);
//
//
// List<PersonEfficiencyStaffReceptionVO> list = personEfficiencyService.queryStaffReception(dto);
// for (PersonEfficiencyStaffReceptionVO vo : list) {
//
// System.out.println(vo.getStaffId());
// System.out.println(vo.getStaffName());
// System.out.println(vo.getStatDate());
// System.out.println(vo.getEntryTime());
// System.out.println(vo.getIsNewemployee());
// System.out.println(vo.getReceptionNum());
// System.out.println(vo.getReceptionNumhb());
// System.out.println(vo.getReceptionNumhbsj());
// System.out.println(vo.getSucceedNum());
// System.out.println(vo.getSucceedNumhb());
// System.out.println(vo.getSucceedNumhbsj());
// System.out.println(vo.getZhuanhuanlv());
// System.out.println(vo.getZhuanhuanlvhb());
// System.out.println(vo.getZhuanhuanlvhbsj());
// System.out.println(vo.getAvgzj());
// System.out.println(vo.getAvgzjhb());
// System.out.println(vo.getAvgzjhbsj());
// System.out.println(vo.getAvggf());
// System.out.println(vo.getAvggfhb());
// System.out.println(vo.getAvggfhbsj());
//
// System.out.println("============================");
// }
//
//// System.out.println(baseurl);
//
//
// }
////
//
// @Test
// public void queryStaffReceptionDetail(){
// PersonEffciencySatffReceptionDetailDTO dto = new PersonEffciencySatffReceptionDetailDTO();
//// and statdate between '2024-11-01' and '2024-12-31'
//// and merchant_id = '44209673'
//// AND staff_id IN ( '04b1b794c2f247cfbaea9868cd6c66de' , '618eb83d323645f89d6e437d1f27eae2' )
//
// dto.setStartDate("2024-11-01");
// dto.setEndDate("2024-12-31");
//// dto.setQueryType(DateType.year);
////
////// List<Map> mapList = personEfficiencyMapper.sqlBySelf("select staff_phone,staff_name,entry_time from dj_car_life_staff_base_info where deleted_flag='N'\n" +
////// "and staff_phone in ('15626599738','12365413214','13022222222')");
//////
////// System.out.println("===============");
////// for (Map map : mapList) {
////// if(map!=null){
////// System.out.println(map.get("staff_name")+","+map.get("staff_phone")+","+map.get("entry_time"));
////// }
////// }
////// System.out.println("<<<<<<<<<<<<<<<<<");
////
////
//// }
////
////
////
//// @Test
//// public void queryStaffReception() throws ParseException {
//// PersonEffciencySatffReceptionDTO dto = new PersonEffciencySatffReceptionDTO();
////
//// String startString = "2024-10-12";
//// String endString = "2024-10-19";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date startDate = sdf.parse(startString);
//// Date endDate = sdf.parse(endString);
//// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
//// dto.setStartDate(startDate);
//// dto.setEndDate(endDate);
////// dto.setQueryType(DateType.year);
//// dto.setMerchantId("44212556");
//// List<String> staffids=new ArrayList<>();
//// staffids.add("04b1b794c2f247cfbaea9868cd6c66de");
//// staffids.add("1623e8438ac5417fabe4a19bb67e2a69");
////// staffids.add("618eb83d323645f89d6e437d1f27eae2");
////// staffids.add("d36e50848801405d82b7e9ff6990d5d8");
////// staffids.add("66835aaebec24d40b6a44c45480cd3fd");
//// staffids.add("4f69767e9d1a437fb42437f8de56b5d2");
//// staffids.add("6825aaebf4f04f6a8a4c3d5a9b26c914");
//// staffids.add("8aab9628ec764fe6b89b4aefe82320e1");
//// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
//// dto.setStaffIds(staffids);
//
//
// List<PersonEfficiencyStaffReceptionDetailVO> list = personEfficiencyService.queryStaffReceptionDetail(dto);
// for (PersonEfficiencyStaffReceptionDetailVO vo : list) {
//
// System.out.println(vo.getStaffId());
// System.out.println(vo.getStaffName());
// System.out.println(vo.getAppresult());
// System.out.println(vo.getCustomerName());
// System.out.println(vo.getCustomerType());
// System.out.println(vo.getAnxinDeal());
// System.out.println(vo.getCarType());
// System.out.println(vo.getAnxinOpen());
// System.out.println(vo.getEndTime());
// System.out.println(vo.getStartTime());
// System.out.println(vo.getReceptionDuration());
// System.out.println(vo.getReceptionDate());
// System.out.println(vo.getRelationOrder());
// System.out.println(vo.getPredictResult());
//
//
// System.out.println("============================");
// }
//
//// System.out.println(baseurl);
//
//
// }
//
// @Test
// public void queryStaffWarningStatus(){
// PersonEffciencySatffWarningDTO dto = new PersonEffciencySatffWarningDTO();
// dto.setStartDate("2024-12-01");
// dto.setEndDate("2024-12-31");
////
////
//// List<PersonEfficiencyStaffReceptionVO> list = personEfficiencyService.queryStaffReception(dto);
//// for (PersonEfficiencyStaffReceptionVO vo : list) {
////
//// System.out.println(vo.getStaffId());
//// System.out.println(vo.getStaffName());
//// System.out.println(vo.getStatDate());
//// System.out.println(vo.getEntryTime());
//// System.out.println(vo.getIsNewemployee());
//// System.out.println(vo.getReceptionNum());
//// System.out.println(vo.getReceptionNumhb());
//// System.out.println(vo.getReceptionNumhbsj());
//// System.out.println(vo.getSucceedNum());
//// System.out.println(vo.getSucceedNumhb());
//// System.out.println(vo.getSucceedNumhbsj());
//// System.out.println(vo.getZhuanhuanlv());
//// System.out.println(vo.getZhuanhuanlvhb());
//// System.out.println(vo.getZhuanhuanlvhbsj());
//// System.out.println(vo.getAvgzj());
//// System.out.println(vo.getAvgzjhb());
//// System.out.println(vo.getAvgzjhbsj());
//// System.out.println(vo.getAvggf());
//// System.out.println(vo.getAvggfhb());
//// System.out.println(vo.getAvggfhbsj());
////
//// System.out.println("============================");
//// }
////
////// System.out.println(baseurl);
////
////
//// }
//////
////
//// @Test
//// public void queryStaffReceptionDetail(){
//// PersonEffciencySatffReceptionDetailDTO dto = new PersonEffciencySatffReceptionDetailDTO();
////// and statdate between '2024-11-01' and '2024-12-31'
////// and merchant_id = '44209673'
////// AND staff_id IN ( '04b1b794c2f247cfbaea9868cd6c66de' , '618eb83d323645f89d6e437d1f27eae2' )
////
//// dto.setStartDate("2024-11-01");
//// dto.setEndDate("2024-11-30");
// dto.setMerchantId("44210895");
// dto.setQueryType(DateType.month);
// dto.setBusinessType(2);
// List<String> staffList=new ArrayList<>();
// staffList.add("08ba3f240adc46b0ba8d08cca6caf938");
// staffList.add("2b968b53b18b42558fae89a7b356f4b3");
// staffList.add("3f021751fd244b76b89da11e14e8eb45");
// staffList.add("6825aaebf4f04f6a8a4c3d5a9b26c914");
// staffList.add("9ec5c68f73e84357a427da9503a5ee8b");
// staffList.add("a56e1a9cdd6049198d1610595b936993");
// dto.setStaffIds(staffList);
//
// List<PersonEfficiencyStaffWarningVO> list = personEfficiencyService.queryStaffWarningStatus(dto);
// for (PersonEfficiencyStaffWarningVO vo : list) {
// System.out.println(vo.getStaffId());
// System.out.println(vo.getStaffName());
// System.out.println(vo.getEntryTime());
// System.out.println(vo.getIsNewemployee());
// System.out.println(vo.getStage1todo());
// System.out.println(vo.getStage1prebook());
// System.out.println(vo.getStage1finished());
// System.out.println("============================");
// }
//
//// System.out.println(baseurl);
//// dto.setEndDate("2024-12-31");
////// dto.setQueryType(DateType.year);
////// List<String> staffids=new ArrayList<>();
////// staffids.add("04b1b794c2f247cfbaea9868cd6c66de");
////// staffids.add("1623e8438ac5417fabe4a19bb67e2a69");
//////// staffids.add("618eb83d323645f89d6e437d1f27eae2");
//////// staffids.add("d36e50848801405d82b7e9ff6990d5d8");
//////// staffids.add("66835aaebec24d40b6a44c45480cd3fd");
////// dto.setStaffIds(staffids);
////
////
//// List<PersonEfficiencyStaffReceptionDetailVO> list = personEfficiencyService.queryStaffReceptionDetail(dto);
//// for (PersonEfficiencyStaffReceptionDetailVO vo : list) {
////
//// System.out.println(vo.getStaffId());
//// System.out.println(vo.getStaffName());
//// System.out.println(vo.getAppresult());
//// System.out.println(vo.getCustomerName());
//// System.out.println(vo.getCustomerType());
//// System.out.println(vo.getAnxinDeal());
//// System.out.println(vo.getCarType());
//// System.out.println(vo.getAnxinOpen());
//// System.out.println(vo.getEndTime());
//// System.out.println(vo.getStartTime());
//// System.out.println(vo.getReceptionDuration());
//// System.out.println(vo.getReceptionDate());
//// System.out.println(vo.getRelationOrder());
//// System.out.println(vo.getPredictResult());
////
////
//// System.out.println("============================");
//// }
////
////// System.out.println(baseurl);
////
////
//// }
////
//// @Test
//// public void queryStaffWarningStatus(){
//// PersonEffciencySatffWarningDTO dto = new PersonEffciencySatffWarningDTO();
//// dto.setStartDate("2024-12-01");
//// dto.setEndDate("2024-12-31");
////// dto.setStartDate("2024-11-01");
////// dto.setEndDate("2024-11-30");
//// dto.setMerchantId("44210895");
//// dto.setQueryType(DateType.month);
//// dto.setBusinessType(2);
//// List<String> staffList=new ArrayList<>();
//// staffList.add("08ba3f240adc46b0ba8d08cca6caf938");
//// staffList.add("2b968b53b18b42558fae89a7b356f4b3");
//// staffList.add("3f021751fd244b76b89da11e14e8eb45");
//// staffList.add("6825aaebf4f04f6a8a4c3d5a9b26c914");
//// staffList.add("9ec5c68f73e84357a427da9503a5ee8b");
//// staffList.add("a56e1a9cdd6049198d1610595b936993");
//// dto.setStaffIds(staffList);
////
//// List<PersonEfficiencyStaffWarningVO> list = personEfficiencyService.queryStaffWarningStatus(dto);
//// for (PersonEfficiencyStaffWarningVO vo : list) {
//// System.out.println(vo.getStaffId());
//// System.out.println(vo.getStaffName());
//// System.out.println(vo.getEntryTime());
//// System.out.println(vo.getIsNewemployee());
//// System.out.println(vo.getStage1todo());
//// System.out.println(vo.getStage1prebook());
//// System.out.println(vo.getStage1finished());
//// System.out.println("============================");
//// }
////
////// System.out.println(baseurl);
////
////
//// }
////
//
//
// }
//
}
//}
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoServiceTest.java
View file @
6e4b2d3
...
...
@@ -2,13 +2,20 @@ package cn.com.glsx.dj.supervisor.service;
import
cn.com.glsx.dj.supervisor.dto.SupervisorManageSummaryDTO
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskSummaryDTO
;
import
cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse
;
import
cn.com.glsx.dj.supervisor.model.SupervisorTaskImage
;
import
cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.Page
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* @Title:
...
...
@@ -61,4 +68,130 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
SupervisorManageSummaryDTO
manageSummary
=
supervisorTaskInfoService
.
getManageSummary
();
System
.
out
.
println
(
JSON
.
toJSONString
(
manageSummary
));
}
@Test
public
void
testGenerateDayTask
()
{
String
startTimeStr
=
"2026-03-11"
;
supervisorTaskInfoService
.
generateDayTask
(
startTimeStr
);
}
/**
* 测试生成周报任务
*/
@Test
public
void
testGenerateWeekTask
()
{
String
startTimeStr
=
"2026-03-09"
;
String
endTimeStr
=
"2026-03-15"
;
supervisorTaskInfoService
.
generateWeekTask
(
startTimeStr
,
endTimeStr
);
}
/**
* 测试生成月报任务
*/
@Test
public
void
testGenerateMonthTask
()
{
String
startTimeStr
=
"2026-03-01"
;
String
endTimeStr
=
"2026-03-31"
;
supervisorTaskInfoService
.
generateMonthTask
(
startTimeStr
,
endTimeStr
);
}
/**
* 测试提交周报任务
*/
@Test
public
void
testSubmitWeekTask
()
{
SupervisorTaskDTO
request
=
new
SupervisorTaskDTO
();
request
.
setId
(
6L
);
// 设置其他全部参数
request
.
setTaskContext
(
"督导周报记录"
);
List
<
SupervisorTaskImage
>
taskImageList
=
new
ArrayList
<>();
SupervisorTaskImage
image
=
new
SupervisorTaskImage
();
image
.
setImageUrl
(
"http://oss.glsx.com/123456.jpg"
);
taskImageList
.
add
(
image
);
request
.
setTaskImageList
(
taskImageList
);
request
.
setUpdatedBy
(
"周敏"
);
request
.
setUpdatedPhone
(
"18682474862"
);
List
<
SupervisorWeekTaskStaff
>
weekTaskStaffList
=
new
ArrayList
<>();
SupervisorWeekTaskStaff
staff
=
new
SupervisorWeekTaskStaff
();
staff
.
setStaffName
(
"测试"
);
staff
.
setStaffPhone
(
"16666666666"
);
weekTaskStaffList
.
add
(
staff
);
request
.
setWeekTaskStaffList
(
weekTaskStaffList
);
supervisorTaskInfoService
.
submitDayTask
(
request
);
}
/**
* 测试提交日报任务
*
*/
@Test
public
void
testSubmitDayTask
()
{
SupervisorTaskDTO
request
=
new
SupervisorTaskDTO
();
request
.
setId
(
3L
);
// 设置其他全部参数
request
.
setMerchantId
(
43423334
);
request
.
setMerchantName
(
"萨达梵蒂冈"
);
request
.
setOnDutyFlag
(
0
);
request
.
setTaskContext
(
"督导日报记录"
);
List
<
SupervisorTaskImage
>
taskImageList
=
new
ArrayList
<>();
SupervisorTaskImage
image
=
new
SupervisorTaskImage
();
image
.
setImageUrl
(
"http://oss.glsx.com/123456.jpg"
);
taskImageList
.
add
(
image
);
request
.
setTaskImageList
(
taskImageList
);
request
.
setUpdatedBy
(
"周敏"
);
request
.
setUpdatedPhone
(
"18682474862"
);
supervisorTaskInfoService
.
submitDayTask
(
request
);
}
/**
* 测试提交月报任务
*/
@Test
public
void
testSubmitMonthTask
()
{
SupervisorTaskDTO
request
=
new
SupervisorTaskDTO
();
request
.
setId
(
9L
);
// 设置其他全部参数
request
.
setTaskContext
(
"督导月报记录"
);
request
.
setUpdatedBy
(
"周敏"
);
request
.
setUpdatedPhone
(
"18682474862"
);
supervisorTaskInfoService
.
submitMonthTask
(
request
);
}
@Test
public
void
testPageTask
()
{
RpcPagination
<
SupervisorTaskQueryDTO
>
request
=
new
RpcPagination
<>();
SupervisorTaskQueryDTO
queryDTO
=
new
SupervisorTaskQueryDTO
();
queryDTO
.
setSupervisorPhone
(
"18682474862"
);
request
.
setCondition
(
queryDTO
);
List
<
Integer
>
typeList
=
Arrays
.
asList
(
0
,
3
,
5
);
queryDTO
.
setTaskTypeList
(
typeList
);
request
.
setPageSize
(
10
);
request
.
setPageNum
(
1
);
Page
<
SupervisorTaskDTO
>
supervisorTaskDTOS
=
supervisorTaskInfoService
.
pageTask
(
request
);
System
.
out
.
println
(
JSON
.
toJSONString
(
supervisorTaskDTOS
));
}
/**
* 根据ID查询督导任务详情
*/
@Test
public
void
testGetTaskDetail
()
{
Long
id
=
6L
;
SupervisorTaskDTO
taskDetail
=
supervisorTaskInfoService
.
getTaskDetailById
(
id
);
System
.
out
.
println
(
JSON
.
toJSONString
(
taskDetail
));
}
/**
* 测试查询督导任务汇总信息
*/
@Test
public
void
testGetTaskSummary
()
{
SupervisorTaskQueryDTO
queryDTO
=
new
SupervisorTaskQueryDTO
();
queryDTO
.
setStartDate
(
"2026-03-01"
);
queryDTO
.
setEndDate
(
"2026-03-31"
);
queryDTO
.
setTaskTypeList
(
Arrays
.
asList
(
0
,
3
,
5
));
SupervisorTaskSummaryDTO
summary
=
supervisorTaskInfoService
.
getTaskSummary
(
queryDTO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
summary
));
}
}
\ No newline at end of file
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorWarningBaselineConfigServiceTest.java
0 → 100644
View file @
6e4b2d3
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
service
;
import
cn.com.glsx.dj.supervisor.dto.WarningBaselineConfigDTO
;
import
cn.com.glsx.dj.supervisor.model.SupervisorWarningBaselineConfig
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
SupervisorWarningBaselineConfigServiceTest
extends
BaseServiceTest
{
@Autowired
private
SupervisorWarningBaselineConfigService
supervisorWarningBaselineConfigService
;
/**
* 创建或修改预警基线配置
*/
@Test
public
void
testCreateOrUpdateWarningBaselineConfig
()
{
WarningBaselineConfigDTO
config
=
new
WarningBaselineConfigDTO
();
config
.
setIndicatorCode
(
"A036"
);
config
.
setIndicatorName
(
"个人产值"
);
config
.
setTimeDimension
(
2
);
List
<
SupervisorWarningBaselineConfig
>
configList
=
new
java
.
util
.
ArrayList
<>();
SupervisorWarningBaselineConfig
redItem
=
new
SupervisorWarningBaselineConfig
();
redItem
.
setMinValue
(
new
BigDecimal
(
0
));
redItem
.
setMaxValue
(
new
BigDecimal
(
1200
));
redItem
.
setMaxValueInf
(
0
);
redItem
.
setWarningLevel
(
0
);
redItem
.
setId
(
4L
);
configList
.
add
(
redItem
);
SupervisorWarningBaselineConfig
yellowItem
=
new
SupervisorWarningBaselineConfig
();
yellowItem
.
setMinValue
(
new
BigDecimal
(
1200
));
yellowItem
.
setMaxValue
(
new
BigDecimal
(
4000
));
yellowItem
.
setMaxValueInf
(
0
);
yellowItem
.
setWarningLevel
(
1
);
yellowItem
.
setId
(
5L
);
configList
.
add
(
yellowItem
);
SupervisorWarningBaselineConfig
greenItem
=
new
SupervisorWarningBaselineConfig
();
greenItem
.
setMinValue
(
new
BigDecimal
(
4000
));
greenItem
.
setMaxValue
(
new
BigDecimal
(
6000
));
greenItem
.
setMaxValueInf
(
0
);
greenItem
.
setWarningLevel
(
2
);
greenItem
.
setId
(
6L
);
configList
.
add
(
greenItem
);
config
.
setConfigList
(
configList
);
config
.
setUpdatedBy
(
"system"
);
Boolean
result
=
supervisorWarningBaselineConfigService
.
createOrUpdateWarningBaselineConfig
(
config
);
assertTrue
(
result
);
}
/**
* 查询所有预警基线配置
*/
@Test
public
void
testListAllWarningBaselineConfig
()
{
List
<
WarningBaselineConfigDTO
>
configList
=
supervisorWarningBaselineConfigService
.
listAllWarningBaselineConfig
();
assertTrue
(
configList
.
size
()
>
0
);
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment