bug修改

master
wangweijia 6 years ago
parent 7e1ff33fe0
commit 2c20977d15

@ -327,7 +327,18 @@ public class CustomerService {
* @param sellerId
*/
public List<OpCustomerDTO> getCustomerInfoBySellerId(long sellerId, Date startDate, Date endDate, int pageNum, int pageSize){
PageHelper.startPage(pageNum,pageSize);
List<OpCustomerDTO> customers = opCustomerDOMapper.selectCustomerInfoBySellerId(sellerId, startDate, endDate);
AtomicInteger number = new AtomicInteger(1 + ((pageNum-1) * pageSize));
//求分页总数
Page<OpCustomerDTO> pageList = (Page<OpCustomerDTO>)customers;
Long totalSize = pageList.getTotal();
for (OpCustomerDTO m : customers ) {
m.setTotalSize(totalSize);
m.setNumber(number.get());
number.incrementAndGet();
}
return customers;
}

@ -4,6 +4,7 @@ import com.kiisoo.ic.common.BaseController;
import com.kiisoo.ic.customer.CustomerService;
import com.kiisoo.ic.customer.bean.OpCustomerDTO;
import com.kiisoo.ic.customer.entity.OpCustomer;
import com.kiisoo.ic.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
@ -35,7 +36,7 @@ public class CustomerController extends BaseController {
List<OpCustomerDTO> opCustomerDTOS = null;
try {
opCustomerDTOS = customerService.getCustomerByUserAndDate(userId, shopId, regionId, sellerId,companyId,
StringUtils.isBlank(startDate) ? null : sdf.parse(startDate), StringUtils.isBlank(endDate) ? null : sdf.parse(endDate) ,pageNum,pageSize);
StringUtils.isBlank(startDate) ? null : sdf.parse(startDate), StringUtils.isBlank(endDate) ? null : DateUtils.addDay(sdf.parse(endDate),1) ,pageNum,pageSize);
return data(opCustomerDTOS);
} catch (ParseException e) {

@ -0,0 +1,20 @@
package com.kiisoo.ic.utils;
import java.util.Calendar;
import java.util.Date;
/**
*
*/
public class DateUtils {
/**
*
*/
public static Date addDay(Date date, int addNum){
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DAY_OF_MONTH, addNum);
return c.getTime();
}
}

@ -28,7 +28,7 @@
and t1.create_time >= #{startDate}
</if>
<if test="endDate != null">
and t1.create_time <![CDATA[ <= ]]> #{endDate}
and t1.create_time <![CDATA[ < ]]> #{endDate}
</if>
order by t2.id,t1.user_id asc
</select>
@ -46,7 +46,7 @@
and t1.create_time >= #{startDate}
</if>
<if test="endDate != null">
and t1.create_time <![CDATA[ <= ]]> #{endDate}
and t1.create_time <![CDATA[ < ]]> #{endDate}
</if>
GROUP BY t2.id
order by t2.id asc

@ -53,7 +53,7 @@ public class OrganizationInitCustomer {
maxRow = 0;
dataType = "customer";
sheetNum = "客户";
regionLevel = 1;
regionLevel = 3;
}
@Autowired

@ -56,7 +56,7 @@ public class OrganizationInitRegion {
maxRow = 0;
dataType = "region";
sheetNum = 0;
regionLevel = 3;
regionLevel = 1;
}
@Autowired

Loading…
Cancel
Save