Commit 6e4b2d3b by 范富荣

修改查询督导任务管理模块接口

1 parent b71f8f67
...@@ -37,12 +37,11 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -37,12 +37,11 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "在岗标识 0-在岗 1-调休(日报)") @ApiModelProperty(notes = "在岗标识 0-在岗 1-调休(日报)")
private Integer onDutyFlag; private Integer onDutyFlag;
@NotNull(groups = {SupervisorTaskInfoRemote.SubmitDayTask.class}, message = "门店ID不能为空")
@ApiModelProperty(notes = "门店ID") @ApiModelProperty(notes = "门店ID")
private Integer merchantId; private Integer merchantId;
@NotEmpty(groups = {SupervisorTaskInfoRemote.SubmitDayTask.class}, message = "门店名称不能为空")
@ApiModelProperty(notes = "门店名称") @ApiModelProperty(notes = "门店名称")
private String merchantName; private String merchantName;
...@@ -110,7 +109,7 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -110,7 +109,7 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "周任务人员列表") @ApiModelProperty(notes = "周任务人员列表")
private List<SupervisorWeekTaskStaff> weekTaskStaffList; private List<SupervisorWeekTaskStaff> weekTaskStaffList;
@NotEmpty(groups = {SupervisorTaskInfoRemote.SubmitDayTask.class, SupervisorTaskInfoRemote.SubmitWeekTask.class}, message = "照片图片列表不能为空") @NotEmpty(groups = {SupervisorTaskInfoRemote.SubmitWeekTask.class}, message = "照片图片列表不能为空")
@ApiModelProperty(notes = "照片图片列表") @ApiModelProperty(notes = "照片图片列表")
private List<SupervisorTaskImage> taskImageList; private List<SupervisorTaskImage> taskImageList;
......
...@@ -13,7 +13,7 @@ public class SupervisorTaskSummaryDTO implements Serializable { ...@@ -13,7 +13,7 @@ public class SupervisorTaskSummaryDTO implements Serializable {
/** /**
* 总人数 * 总人数
*/ */
@ApiModelProperty(notes = "总人数") @ApiModelProperty(notes = "督导总人数")
private Integer totalCount; private Integer totalCount;
/** /**
......
...@@ -145,31 +145,18 @@ public class SupervisorTaskInfoService { ...@@ -145,31 +145,18 @@ public class SupervisorTaskInfoService {
summary.setTotalCount(0); summary.setTotalCount(0);
summary.setManagedStoreCount(0); summary.setManagedStoreCount(0);
summary.setMonthlyOutput(java.math.BigDecimal.ZERO); summary.setMonthlyOutput(java.math.BigDecimal.ZERO);
//查询在职督导总人数
// 1. 查询全部督导列表
List<MerchantStaffResponse> supervisorList = listAllSupervisors(); List<MerchantStaffResponse> supervisorList = listAllSupervisors();
if (CollectionUtils.isEmpty(supervisorList)) { if (CollectionUtils.isEmpty(supervisorList)) {
log.info("督导列表为空,返回默认汇总"); log.info("督导列表为空,返回默认汇总");
return summary; return summary;
} }
List<String> phoneList = supervisorList.stream() List<String> phoneList = supervisorList.stream()
.map(MerchantStaffResponse::getStaffPhone) .map(MerchantStaffResponse::getStaffPhone)
.filter(phone -> phone != null && !phone.isEmpty()) .filter(phone -> phone != null && !phone.isEmpty())
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
summary.setTotalCount(getEffectiveSupervisors(phoneList));
// 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);
// 3. 查询 director_config 表,统计所有督导负责的门店(director_type=6,平台中飞行督导) // 3. 查询 director_config 表,统计所有督导负责的门店(director_type=6,平台中飞行督导)
List<Integer> merchantIdList = supervisorTaskInfoMapper.queryMerchantBySupervisorPhone(phoneList); List<Integer> merchantIdList = supervisorTaskInfoMapper.queryMerchantBySupervisorPhone(phoneList);
...@@ -185,6 +172,25 @@ public class SupervisorTaskInfoService { ...@@ -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 * @return
*/ */
...@@ -306,7 +312,12 @@ public class SupervisorTaskInfoService { ...@@ -306,7 +312,12 @@ public class SupervisorTaskInfoService {
//查询所有飞行督导员工列表 //查询所有飞行督导员工列表
List<MerchantStaffResponse> merchantStaffResponses = listAllSupervisors(); List<MerchantStaffResponse> merchantStaffResponses = listAllSupervisors();
if (CollectionUtils.isNotEmpty(merchantStaffResponses)) { 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); List<SupervisorTaskDTO> taskList = supervisorTaskInfoMapper.listTask(request);
......
...@@ -40,6 +40,7 @@ public class SupervisorWarningBaselineConfigService { ...@@ -40,6 +40,7 @@ public class SupervisorWarningBaselineConfigService {
// 新增 // 新增
config.getConfigList().stream().forEach(item -> { config.getConfigList().stream().forEach(item -> {
item.setIndicatorCode(config.getIndicatorCode()); item.setIndicatorCode(config.getIndicatorCode());
item.setIndicatorName(config.getIndicatorName());
item.setTimeDimension(config.getTimeDimension()); item.setTimeDimension(config.getTimeDimension());
item.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name()); item.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
item.setCreatedBy(config.getUpdatedBy()); item.setCreatedBy(config.getUpdatedBy());
...@@ -77,7 +78,7 @@ public class SupervisorWarningBaselineConfigService { ...@@ -77,7 +78,7 @@ public class SupervisorWarningBaselineConfigService {
} }
criteria.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name()); criteria.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
//根据更新时间降序 //根据更新时间降序
example.setOrderByClause("updatedDate desc"); example.setOrderByClause("updated_date desc");
return supervisorWarningBaselineConfigMapper.selectByExample(example); return supervisorWarningBaselineConfigMapper.selectByExample(example);
} }
......
...@@ -100,6 +100,9 @@ ...@@ -100,6 +100,9 @@
<if test="taskStatus != null"> <if test="taskStatus != null">
and sti.task_status = #{taskStatus} and sti.task_status = #{taskStatus}
</if> </if>
<if test="updatedBy != null and updatedBy != ''">
and sti.updated_by like concat('%', #{updatedBy}, '%')
</if>
</where> </where>
order by sti.task_status asc, sti.create_time desc order by sti.task_status asc, sti.create_time desc
</select> </select>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</sql> </sql>
<update id="batchUpdate"> <update id="batchUpdate">
UPDATE t_warning_baseline_config UPDATE supervisor_warning_baseline_config
SET SET
min_value = CASE min_value = CASE
<foreach collection="list" item="item" separator=""> <foreach collection="list" item="item" separator="">
......
package cn.com.glsx.dj.supervisor.remote; //package cn.com.glsx.dj.supervisor.remote;
//
import cn.com.glsx.dj.supervisor.mapper.PersonEfficiencyMapper; //import cn.com.glsx.dj.supervisor.mapper.PersonEfficiencyMapper;
import cn.com.glsx.dj.riskmanage.model.DemoModel; //import cn.com.glsx.dj.riskmanage.model.DemoModel;
import cn.com.glsx.dj.supervisor.remote.sem.PersonEfficiencyRemoteImpl; //import cn.com.glsx.dj.supervisor.remote.sem.PersonEfficiencyRemoteImpl;
import cn.com.glsx.dj.supervisor.service.DemoService; //import cn.com.glsx.dj.supervisor.service.DemoService;
import cn.com.glsx.dj.supervisor.service.PersonEfficiencyService; //import cn.com.glsx.dj.supervisor.service.PersonEfficiencyService;
import cn.com.glsx.dj.supervisor.service.ProductEfficiencyService; //import cn.com.glsx.dj.supervisor.service.ProductEfficiencyService;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference; //import org.apache.dubbo.config.annotation.DubboReference;
import org.junit.Test; //import org.junit.Test;
//import org.oreframework.util.http.HttpUtil; ////import org.oreframework.util.http.HttpUtil;
//
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
//
//import java.text.ParseException; ////import java.text.ParseException;
//import java.text.SimpleDateFormat; ////import java.text.SimpleDateFormat;
//import java.util.Date; ////import java.util.Date;
//
//
/** ///**
* @Title: DemoRemoteTest.java // * @Title: DemoRemoteTest.java
* @Description: // * @Description:
* @author deployer name // * @author deployer name
* @version V1.0 // * @version V1.0
* @Company: Didihu.com.cn // * @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017 // * @Copyright Copyright (c) 2017
*/ // */
@Slf4j //@Slf4j
public class DemoRemoteTest extends BaseRemoteTest{ //public class DemoRemoteTest extends BaseRemoteTest{
//// @Autowired
//// private RestTemplate restTemplate;
// @DubboReference
// private DemoRemote demoRemote;
//// @Autowired
//// private Environment env;
// @Autowired // @Autowired
// private RestTemplate restTemplate; // private DemoService service;
@DubboReference
private DemoRemote demoRemote;
// @Autowired // @Autowired
// private Environment env; // private PersonEfficiencyRemoteImpl personEfficiencyRemote;
@Autowired // @Autowired
private DemoService service; // private PersonEfficiencyService personEfficiencyService;
@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);
// }
//
//
//
@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);
//
//
// }
// @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")));
// }
//
// }
// @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"); // @Autowired
// RpcResponse<List<PersonEfficiencyVO>> listRpcResponse = personEfficiencyRemote.queryStaffBaseInfo(dto); // private ProductEfficiencyService productEfficiencyService;
// System.out.println(listRpcResponse.getMessage());
// System.out.println(listRpcResponse);
// //
// @Autowired
// private PersonEfficiencyMapper personEfficiencyMapper;
// //
////// List<PersonEfficiencyVO> list = //// @Test
//// for (PersonEfficiencyVO personEfficiencyVO : list) { //// public void testSayHello(){
//// System.out.println(personEfficiencyVO.getStaffid()); //// String result = demoRemote.sayHello("Jerry");
//// System.out.println(personEfficiencyVO.getStaffName()); //// System.out.println(result);
//// 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 // @Test
// public void queryDataPost(){ // public void load(){
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking"); // DemoModel model = demoRemote.get("name");
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl"); // System.out.println(model.getName());
// 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);
// //
//// @Test
//// public void testSayHello(){
//// System.out.println("Jerry");
//// }
// //
//// JsonObject jsonObject = JsonParser.parseString(responseBody).getAsJsonObject(); //// @Test
//// JsonArray contentArray = jsonObject.getAsJsonArray("content"); //// 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);
////
//// ////
//// 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 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";
// client.close(); //// System.out.println(sql);
// } catch (IOException e) { //// List<Map> mapList = personEfficiencyMapper.sqlBySelf(sql);
// e.printStackTrace(); //// for (Map map : mapList) {
// } //// System.out.println(String.valueOf(map.get("staff_name")));
// //// }
// } ////
// //// }
// //// @Test
// //// public void bitest(){
// @Autowired ////
// private RestTemplate restTemplate; //// List<BIQueryMerRankingResponse> list =
// private static CloseableHttpClient httpClient = null; //// service.queryMerRanking(MerRankingBusinessTypeEnum.QUANYI, MerRankingQueryTypeEnum.WEEK, "2024-10-01",
// //// "2024-10-31", null, null);
// @Test ////
// public void testQueryDataApi() { //// if (CollectionUtils.isEmpty(list)) {
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking"); //// log.info("没有二级预警的延保门店");
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl"); //// return;
// String baseUrl = "http://192.168.2.150:8021/data"; //// }else {
// HttpPost httpPost = new HttpPost(baseUrl); //// for (BIQueryMerRankingResponse biQueryMerRankingResponse : list) {
// //// System.out.println(biQueryMerRankingResponse.getMerchantid()+","+biQueryMerRankingResponse.getMerchantname()+","+biQueryMerRankingResponse.getExceptionnum()+","+biQueryMerRankingResponse.getDetails());
// if (null == httpClient) { //// }
// httpClient = HttpClientBuilder.create().build(); //// }
// } //// long storeNum = list.stream().filter(Objects::nonNull).map(BIQueryMerRankingResponse::getMerchantid).distinct().count();
// JSONObject json =new JSONObject(); //// log.info("sendBIStoreExtendedWarrantyLevel2Warning, storeNum:{}", storeNum);
// json.put("biz", null); ////// System.out.println(list);
// 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", "-"); //// @Test
// json.put("startDate", "2024-08-01"); //// public void queryStaffBaseInfo() throws ParseException {
// json.put("step", 10); ////
// try { //// String startString = "2024-04-12";
// StringEntity se = new StringEntity(json.toString()); //// String endString = "2024-10-19";
// se.setContentEncoding("UTF-8"); //// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// //发送json数据需要设置contentType //// Date startDate = sdf.parse(startString);
// se.setContentType("application/json"); //// Date endDate = sdf.parse(endString);
// System.out.println(se.getContent()); ////
// //设置请求参数 //// PersonEffciencyDTO dto = new PersonEffciencyDTO();
// httpPost.setEntity(se); //// dto.setMerchantId("44212556");
// HttpResponse response = httpClient.execute(httpPost); //// dto.setStartDate(startDate);
// log.info("response:{}", response.getEntity()); //// dto.setEndDate(endDate);
// ////// dto.setPackageIds("M230613140258333");
// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { //// dto.setBusinessType(4);
// //返回json格式 ////
// String res = EntityUtils.toString(response.getEntity()); ////// List<String> staffs=new ArrayList<>();
// log.info("res:{}", res); ////// staffs.add("42812613fefd431bb6fe5741eab699c0");
// System.out.println(); ////
// System.out.println(); ////// dto.setStaffIds("42812613fefd431bb6fe5741eab699c0,fd4351e86fa14ed686bae504b19a61ca");
// System.out.println(); //// RpcResponse<List<PersonEfficiencyVO>> listRpcResponse = personEfficiencyRemote.queryStaffBaseInfo(dto);
// System.out.println(); //// System.out.println(listRpcResponse.getMessage());
// System.out.println("res="+res); //// System.out.println(listRpcResponse);
// System.out.println(); ////
// System.out.println(); ////
// System.out.println(); //////// List<PersonEfficiencyVO> list =
// System.out.println(); ////// for (PersonEfficiencyVO personEfficiencyVO : list) {
// } ////// System.out.println(personEfficiencyVO.getStaffid());
// ////// System.out.println(personEfficiencyVO.getStaffName());
// } catch (IOException e) { ////// System.out.println(personEfficiencyVO.getEntryTime());
// e.printStackTrace(); ////// System.out.println(personEfficiencyVO.getIsNewemployee());
// } finally { ////// System.out.println(personEfficiencyVO.getOutput());
// if (httpClient != null) { ////// System.out.println(personEfficiencyVO.getAtv());
// try { ////// System.out.println(personEfficiencyVO.getOrdernum());
// httpClient.close(); ////// System.out.println(personEfficiencyVO.getZhuanhuanlv());
// } catch (IOException e) { ////// System.out.println(personEfficiencyVO.getOutputhb());
// e.printStackTrace(); ////// 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); //// System.out.println("baseUrl="+baseUrl);
//// ////
//// UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(baseUrl) //// // 构建基础的URI
//// .queryParam("biz", null) //// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl);
//// .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(); //// String request = builder.toUriString();
//// log.info("bi queryMerRanking request:{}", request); //// 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); //// 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 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");
// @Test //// String baseUrl = "http://192.168.2.150:8021";
// public void testQueryDataApi02() { ////
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl", "https://glsx-bi-report.glsx.com.cn/overview/queryMerRanking"); //// System.out.println("baseUrl="+baseUrl);
//// String baseUrl = env.getProperty("bi.queryMerRanking.baseUrl"); ////
// String baseUrl = "http://192.168.2.150:8021"; ////
// ////
// System.out.println("baseUrl="+baseUrl); ////
// ////
// // 构建基础的URI //// // 构建基础的URI(类似前面Spring方式构建)
// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl); //// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl);
// //// builder.path("/data");
// String request = builder.toUriString(); //// URI uri = builder.build().toUri();
// log.info("bi queryMerRanking request:{}", request); ////
// //// // 创建HttpClient对象
//// // 添加路径部分 //// HttpClient httpClient = HttpClientBuilder.create().build();
// builder.path("/data"); ////
// //// // 创建HttpPost请求对象,设置请求的URI
// // 构建出最终的URI对象 //// HttpPost httpPost = new HttpPost(uri);
// URI uri = builder.build().toUri(); ////
// //// // 设置请求头(设置Content-Type等)
// // 创建请求头,设置内容类型为JSON //// httpPost.setHeader("Content-Type", "application/json");
// HttpHeaders headers = new HttpHeaders(); ////
// headers.setContentType(MediaType.APPLICATION_JSON); //// // 构建请求体数据
// //// JSONObject requestBody = new JSONObject();
// // 构建请求体数据(这里简单示例,实际按业务构造) //// requestBody.put("username", "testuser");
// com.alibaba.fastjson.JSONObject requestBody = new com.alibaba.fastjson.JSONObject(); //// requestBody.put("password", "testpassword");
// requestBody.put("biz", null); //// requestBody.put("biz", null);
// requestBody.put("endDate", "2024-12-31"); //// requestBody.put("endDate", "2024-12-31");
// requestBody.put("itemCodes", "A001,A002,A003,A004,A005"); //// requestBody.put("itemCodes", "A001,A002,A003,A004,A005");
// requestBody.put("merchantIds", "44212814"); //// requestBody.put("merchantIds", "44212814");
// requestBody.put("productCodes", "-"); //// requestBody.put("productCodes", "-");
// requestBody.put("series", "-"); //// requestBody.put("series", "-");
// requestBody.put("staffIds", "-"); //// requestBody.put("staffIds", "-");
// requestBody.put("staffPhones", "-"); //// requestBody.put("staffPhones", "-");
// requestBody.put("startDate", "2024-08-01"); //// requestBody.put("startDate", "2024-08-01");
// requestBody.put("step", 10); //// requestBody.put("step", 10);
// //// // 将请求体数据封装到StringEntity中,设置编码等
// // 将请求体和请求头封装成HttpEntity //// StringEntity entity = new StringEntity(requestBody.toString(), "UTF-8");
// HttpEntity<String> entity = new HttpEntity<>(requestBody.toString(), headers); //// httpPost.setEntity(entity);
// //// // 发送请求,获取响应
// // 使用RestTemplate发送POST请求 //// HttpResponse response = httpClient.execute(httpPost);
// RestTemplate restTemplate = new RestTemplate(); //// // 处理响应,获取响应内容(这里简单打印)
// String response = restTemplate.postForObject(uri, entity, String.class); //// org.apache.http.HttpEntity responseEntity = response.getEntity();
// System.out.println(); ////// HttpEntity responseEntity = response.getEntity();
// System.out.println(); ////
// System.out.println(); //// String responseString = EntityUtils.toString(responseEntity);
// System.out.println(); ////// System.out.println("Response: " + responseString);
// 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(); //// 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();
// @Test //// System.out.println();
// public void testQueryDataApi03() throws Exception{ //// System.out.println();
//// 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); ////
// ////
// ////
// ////
// //// @Test
// //// public void queryStaffTrend() throws ParseException {
// // 构建基础的URI(类似前面Spring方式构建) //// PersonEffciencyTrendDTO dto = new PersonEffciencyTrendDTO();
// UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl); //////按日
// builder.path("/data"); //// String startString = "2024-10-12";
// URI uri = builder.build().toUri(); //// String endString = "2024-10-19";
//
// // 创建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";
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date startDate = sdf.parse(startString); //// Date startDate = sdf.parse(startString);
//// Date endDate = sdf.parse(endString); //// Date endDate = sdf.parse(endString);
//// dto.setBusinessType(3);//2-轻改,3-权益,4-延保 //// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
//// dto.setStartDate(startDate); //// dto.setStartDate(startDate);
//// dto.setEndDate(endDate); //// dto.setEndDate(endDate);
//// dto.setAllYear(true);
////// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率 ////// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率
//// dto.setMerchantId("44212556"); //// 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-01-01";
// ////// String endString = "2024-12-31";
// String startString = "2024-04-19"; ////// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// String endString = "2024-10-19"; ////// Date startDate = sdf.parse(startString);
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); ////// Date endDate = sdf.parse(endString);
// Date startDate = sdf.parse(startString); ////// dto.setBusinessType(3);//2-轻改,3-权益,4-延保
// Date endDate = sdf.parse(endString); ////// dto.setStartDate(startDate);
// dto.setBusinessType(4);//2-轻改,3-权益,4-延保 ////// dto.setEndDate(endDate);
// dto.setStartDate(startDate); ////// dto.setAllYear(true);
// dto.setEndDate(endDate); //////// dto.setQueryType(1);//1-产值,2-客单价,3-订单数,4-转化率
// dto.setMerchantId("44212556"); ////// dto.setMerchantId("44212556");
// ////
// ////
// List<PersonEfficiencyGoodsListVO> list = personEfficiencyService.queryGoodsList(dto); ////
// for (PersonEfficiencyGoodsListVO vo : list) { ////// List<String> staffids=new ArrayList<>();
// System.out.println(vo.getProductid()); ////// //
// System.out.println(vo.getProductName()); ////// staffids.add("0ab752fe72474710a99c5d04a31217b7");
// System.out.println(vo.getMerchantid()); ////// staffids.add("f6688827a4a24eafa97cafb5a30fd963");
// System.out.println(vo.getBusinessType()); ////// staffids.add("e385f86a56394cf7af1b9d0de9f9b173");
// ////// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
// System.out.println("============================"); ////// dto.setStaffIds(staffids);
// } ////
// ////// dto.setStaffIds("0ab752fe72474710a99c5d04a31217b7,f6688827a4a24eafa97cafb5a30fd963,e385f86a56394cf7af1b9d0de9f9b173");
//// System.out.println(baseurl); ////// dto.setProductIds("M240305154411408");
// } ////
// //// List<PersonEfficiencyOutputTrendVO> list = personEfficiencyService.queryStaffOutputTrend(dto);
//// for (PersonEfficiencyOutputTrendVO vo : list) {
// @Test //// for (StaffTrendDTO staffTrendDTO : vo.getStaffTrendDTOList()) {
// public void getStaffEntryTimeByPhone01() throws ParseException { //// System.out.println(staffTrendDTO.getStatDate());
// //// System.out.println(staffTrendDTO.getStaffId());
// Map<String, String[]> result = getStaffEntryTimeByPhone(); //// System.out.println(staffTrendDTO.getStaffName());
//// result.forEach((k, v) -> System.out.println("Key: " + k + ", Value: " + v[0] + ", " + v[1])); //// System.out.println(staffTrendDTO.getStatDate());
// //// System.out.println(staffTrendDTO.getOutput());
// System.out.println(">>>>>>>>>>>>"); //// System.out.println(staffTrendDTO.getAtv());
// //// System.out.println(staffTrendDTO.getZhuanhuanlv());
// String[] entrytime = result.get("15688845544"); //// }
// //// System.out.println("============================");
// 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)); ////// System.out.println(baseurl);
// ////
// ////
// //// }
// }
//
//
//
//
// 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("<<<<<<<<<<<<<<<<<");
// //
////
//// @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" + //// @Test
//// "and staff_phone in ('15626599738','12365413214','13022222222')"); //// 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);
////
//// ////
//// 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"));
//// } //// }
////
//// @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("<<<<<<<<<<<<<<<<<"); //// 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 ////// List<Map> mapList = personEfficiencyMapper.sqlBySelf("select staff_phone,staff_name,entry_time from dj_car_life_staff_base_info where deleted_flag='N'\n" +
// public void queryStaffReceptionDetail(){ ////// "and staff_phone in ('15626599738','12365413214','13022222222')");
// PersonEffciencySatffReceptionDetailDTO dto = new PersonEffciencySatffReceptionDetailDTO(); //////
//// and statdate between '2024-11-01' and '2024-12-31' ////// System.out.println("===============");
//// and merchant_id = '44209673' ////// for (Map map : mapList) {
//// AND staff_id IN ( '04b1b794c2f247cfbaea9868cd6c66de' , '618eb83d323645f89d6e437d1f27eae2' ) ////// if(map!=null){
// ////// System.out.println(map.get("staff_name")+","+map.get("staff_phone")+","+map.get("entry_time"));
// dto.setStartDate("2024-11-01"); ////// }
// dto.setEndDate("2024-12-31"); ////// }
//// dto.setQueryType(DateType.year); ////// 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<>(); //// List<String> staffids=new ArrayList<>();
//// staffids.add("04b1b794c2f247cfbaea9868cd6c66de"); //// staffids.add("4f69767e9d1a437fb42437f8de56b5d2");
//// staffids.add("1623e8438ac5417fabe4a19bb67e2a69"); //// staffids.add("6825aaebf4f04f6a8a4c3d5a9b26c914");
////// staffids.add("618eb83d323645f89d6e437d1f27eae2"); //// staffids.add("8aab9628ec764fe6b89b4aefe82320e1");
////// staffids.add("d36e50848801405d82b7e9ff6990d5d8"); //// staffids.add("b6a7ae0e0a1b4b2c88ed61e1bc02a391");
////// staffids.add("66835aaebec24d40b6a44c45480cd3fd");
//// dto.setStaffIds(staffids); //// dto.setStaffIds(staffids);
// ////
// ////
// List<PersonEfficiencyStaffReceptionDetailVO> list = personEfficiencyService.queryStaffReceptionDetail(dto); //// List<PersonEfficiencyStaffReceptionVO> list = personEfficiencyService.queryStaffReception(dto);
// for (PersonEfficiencyStaffReceptionDetailVO vo : list) { //// for (PersonEfficiencyStaffReceptionVO vo : list) {
// ////
// System.out.println(vo.getStaffId()); //// System.out.println(vo.getStaffId());
// System.out.println(vo.getStaffName()); //// System.out.println(vo.getStaffName());
// System.out.println(vo.getAppresult()); //// System.out.println(vo.getStatDate());
// System.out.println(vo.getCustomerName()); //// System.out.println(vo.getEntryTime());
// System.out.println(vo.getCustomerType()); //// System.out.println(vo.getIsNewemployee());
// System.out.println(vo.getAnxinDeal()); //// System.out.println(vo.getReceptionNum());
// System.out.println(vo.getCarType()); //// System.out.println(vo.getReceptionNumhb());
// System.out.println(vo.getAnxinOpen()); //// System.out.println(vo.getReceptionNumhbsj());
// System.out.println(vo.getEndTime()); //// System.out.println(vo.getSucceedNum());
// System.out.println(vo.getStartTime()); //// System.out.println(vo.getSucceedNumhb());
// System.out.println(vo.getReceptionDuration()); //// System.out.println(vo.getSucceedNumhbsj());
// System.out.println(vo.getReceptionDate()); //// System.out.println(vo.getZhuanhuanlv());
// System.out.println(vo.getRelationOrder()); //// System.out.println(vo.getZhuanhuanlvhb());
// System.out.println(vo.getPredictResult()); //// System.out.println(vo.getZhuanhuanlvhbsj());
// //// System.out.println(vo.getAvgzj());
// //// System.out.println(vo.getAvgzjhb());
// System.out.println("============================"); //// System.out.println(vo.getAvgzjhbsj());
// } //// System.out.println(vo.getAvggf());
// //// System.out.println(vo.getAvggfhb());
//// System.out.println(baseurl); //// System.out.println(vo.getAvggfhbsj());
// ////
// //// System.out.println("============================");
// } //// }
// ////
// @Test ////// System.out.println(baseurl);
// public void queryStaffWarningStatus(){ ////
// PersonEffciencySatffWarningDTO dto = new PersonEffciencySatffWarningDTO(); ////
// dto.setStartDate("2024-12-01"); //// }
// dto.setEndDate("2024-12-31"); //////
////
//// @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.setStartDate("2024-11-01");
//// dto.setEndDate("2024-11-30"); //// dto.setEndDate("2024-12-31");
// dto.setMerchantId("44210895"); ////// dto.setQueryType(DateType.year);
// dto.setQueryType(DateType.month); ////// List<String> staffids=new ArrayList<>();
// dto.setBusinessType(2); ////// staffids.add("04b1b794c2f247cfbaea9868cd6c66de");
// List<String> staffList=new ArrayList<>(); ////// staffids.add("1623e8438ac5417fabe4a19bb67e2a69");
// staffList.add("08ba3f240adc46b0ba8d08cca6caf938"); //////// staffids.add("618eb83d323645f89d6e437d1f27eae2");
// staffList.add("2b968b53b18b42558fae89a7b356f4b3"); //////// staffids.add("d36e50848801405d82b7e9ff6990d5d8");
// staffList.add("3f021751fd244b76b89da11e14e8eb45"); //////// staffids.add("66835aaebec24d40b6a44c45480cd3fd");
// staffList.add("6825aaebf4f04f6a8a4c3d5a9b26c914"); ////// dto.setStaffIds(staffids);
// staffList.add("9ec5c68f73e84357a427da9503a5ee8b"); ////
// staffList.add("a56e1a9cdd6049198d1610595b936993"); ////
// dto.setStaffIds(staffList); //// List<PersonEfficiencyStaffReceptionDetailVO> list = personEfficiencyService.queryStaffReceptionDetail(dto);
// //// for (PersonEfficiencyStaffReceptionDetailVO vo : list) {
// List<PersonEfficiencyStaffWarningVO> list = personEfficiencyService.queryStaffWarningStatus(dto); ////
// for (PersonEfficiencyStaffWarningVO vo : list) { //// System.out.println(vo.getStaffId());
// System.out.println(vo.getStaffId()); //// System.out.println(vo.getStaffName());
// System.out.println(vo.getStaffName()); //// System.out.println(vo.getAppresult());
// System.out.println(vo.getEntryTime()); //// System.out.println(vo.getCustomerName());
// System.out.println(vo.getIsNewemployee()); //// System.out.println(vo.getCustomerType());
// System.out.println(vo.getStage1todo()); //// System.out.println(vo.getAnxinDeal());
// System.out.println(vo.getStage1prebook()); //// System.out.println(vo.getCarType());
// System.out.println(vo.getStage1finished()); //// System.out.println(vo.getAnxinOpen());
// System.out.println("============================"); //// System.out.println(vo.getEndTime());
// } //// System.out.println(vo.getStartTime());
// //// System.out.println(vo.getReceptionDuration());
//// System.out.println(baseurl); //// 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);
////
////
//// }
////
// //
// //
// }
// //
//}
}
...@@ -2,13 +2,20 @@ package cn.com.glsx.dj.supervisor.service; ...@@ -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.SupervisorManageSummaryDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; 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.SupervisorTaskCourse;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage; 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.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/** /**
* @Title: * @Title:
...@@ -61,4 +68,130 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -61,4 +68,130 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
SupervisorManageSummaryDTO manageSummary = supervisorTaskInfoService.getManageSummary(); SupervisorManageSummaryDTO manageSummary = supervisorTaskInfoService.getManageSummary();
System.out.println(JSON.toJSONString(manageSummary)); 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 \ No newline at end of file
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);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!