anderx лет назад: 4
Родитель
Сommit
8854855f8f

+ 3 - 2
src/main/java/com/goafanti/common/mapper/UserChannelMapper.xml

@@ -208,10 +208,11 @@
     left join district_glossory d1 on c.location_province =d1.id 
     left join district_glossory d2 on c.location_city =d2.id
     where 1=1
-    and a.status > 2
+    and a.status > 2 and a.status < 6
     <if test="aid !=null">
     and a.aid= #{aid} 
     </if>
+    order by  a.create_time desc
     <if test="page_sql != null">
     	${page_sql}
     </if>
@@ -223,7 +224,7 @@
     left join district_glossory d1 on c.location_province =d1.id 
     left join district_glossory d2 on c.location_city =d2.id
     where 1=1
-    and a.status &gt; 2
+    and a.status &gt; 2 and a.status &lt; 6
     <if test="aid !=null">
     and a.aid= #{aid} 
     </if>

+ 2 - 1
src/main/java/com/goafanti/common/utils/ExcelUtils.java

@@ -742,7 +742,8 @@ public class ExcelUtils {
     public static String  getCellValue(Cell cell) {
         String value = "";
         if (cell != null) {
-            switch (cell.getCellTypeEnum()) {
+        	CellType cellType=cell.getCellTypeEnum();
+            switch (cellType) {
                 case NUMERIC:  //数字
                     value = cell.getNumericCellValue() + "";
                     if (HSSFDateUtil.isCellDateFormatted(cell)) {

+ 13 - 2
src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java

@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.ss.usermodel.BorderStyle;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellStyle;
@@ -44,11 +45,14 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellRangeAddressList;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
 import org.apache.poi.xssf.usermodel.XSSFDataValidation;
+import org.apache.poi.xssf.usermodel.XSSFFont;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -184,7 +188,13 @@ public class NewExcelUtil<T> {
 			for (int index = 0; index <= sheetNo; index++) {
 				createSheet(sheetNo, index);
 				// 产生一行
-				Row row = sheet.createRow(0);
+				Row title = sheet.createRow(0);
+				Cell cell = title.createCell(0);
+				cell.setCellValue(sheetName);
+				CellRangeAddress region = new CellRangeAddress(0, 0, 0, fields.size()-1);
+				sheet.addMergedRegion(region);
+				cell.setCellStyle(styles.get("header"));
+				Row row = sheet.createRow(1);
 				int column = 0;
 				// 写入各个字段的列头名称
 				for (Object[] os : fields) {
@@ -213,6 +223,7 @@ public class NewExcelUtil<T> {
 		}
 	}
 
+
 	private String DateFilename(String sheetName) {
 		sheetName =  sheetName + "_" + DateUtils.formatDate(new Date(), AFTConstants.YYYYMMDDHHMMSS)+".xlsx";
 		return sheetName;
@@ -289,7 +300,7 @@ public class NewExcelUtil<T> {
 		int startNo = index * sheetSize;
 		int endNo = Math.min(startNo + sheetSize, list.size());
 		for (int i = startNo; i < endNo; i++) {
-			row = sheet.createRow(i + 1 - startNo);
+			row = sheet.createRow(i + 2 - startNo);
 			// 得到导出对象.
 			T vo = (T) list.get(i);
 			int column = 0;

+ 8 - 6
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -2083,12 +2083,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Date date = new Date();
 		Integer i = userMapper.updatechannelCustomerDeliver(uids, receiveId);
 		Integer status=null;
-		String role=userMapper.checkRoleMax(receiveId);
-		if (role.equals(AFTConstants.SALESMAN_MANAGER)) {
-			status=1;
-		}else {
-			status=2;
-		}
+		
 		
 		if (i > 0) {
 			List<UserTransferLog> l = new ArrayList<UserTransferLog>();
@@ -2113,12 +2108,19 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		}
 		if (type!=2) {
 			userLockReleaseMapper.insertChannelList(uids,receiveId);
+			String role=userMapper.checkRoleMax(receiveId);
+			if (role.equals(AFTConstants.SALESMAN_MANAGER)) {
+				status=1;
+			}else {
+				status=2;
+			}
 		}else {
 			userLockReleaseMapper.updateChannelList(uids,receiveId);
 		}
 		if(type==0) {
 			userChannelMapper.updateByuids(uids, type, date,receiveId,status);
 		}else {
+			
 			userChannelMapper.updateByuids(uids, type, date,null,status);
 		}
 		

+ 3 - 3
src/main/java/com/goafanti/user/bo/OutUserChannel.java

@@ -85,13 +85,13 @@ public class OutUserChannel  {
 	private String contacts;
 	@Excel(name = "联系人电话")
 	private String contactMobile;
-	@Excel(name = "导入时间")
-	private String createTimes;
 	@Excel(name = "备注")
 	private String remarks;
+	@Excel(name = "导入时间")
+	private String createTimes;
 	private Integer guidance;
 	private Integer recovery;
-	@Excel(name = "未导入原因",readConverterExp = " 3=已存在私有,4=已存在公共,5=已存在签单")
+	@Excel(name = "未导入原因",readConverterExp = "3=已存在私有,4=已存在公共,5=已存在签单")
 	private Integer status;
     public String getRemarks() {
 		return remarks;

+ 1 - 1
src/main/java/com/goafanti/user/controller/UserChannelApiController.java

@@ -117,7 +117,7 @@ public class UserChannelApiController  extends CertifyApiController{
     	  @SuppressWarnings("unchecked")
 		List<OutUserChannel> list =(List<OutUserChannel>) userChannelService.getErorrList(1,99999).getList();
       	NewExcelUtil<OutUserChannel>excel=new NewExcelUtil<>(OutUserChannel.class);
-  		 return  excel.exportExcel(list,"渠道客户",response);
+  		 return  excel.exportExcel(list,"未导入渠道客户",response);
       	}
       /**
   	 * 	下载回款批量导入Excel模板

+ 7 - 3
src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java

@@ -25,7 +25,6 @@ import com.goafanti.common.bo.ProvinceBo;
 import com.goafanti.common.dao.DistrictGlossoryMapper;
 import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
-import com.goafanti.common.dao.UserCareerMapper;
 import com.goafanti.common.dao.UserChannelMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.dao.UserTransferLogMapper;
@@ -216,8 +215,13 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
         	userChannelMapper.insertBatch(list);
         	userTransferLogMapper.insertBatch(list);
 		}
-    	if(!list2.isEmpty())userChannelMapper.insertBatch(list2);
-    	return getErorrList(1,10);
+    	if(list2.isEmpty()) {
+    		return 1;
+    	}else {
+    		userChannelMapper.insertBatch(list2);
+    		return getErorrList(1,10);
+    	}
+    	
     }