Просмотр исходного кода

Merge branch 'test'

# Conflicts:
#	.idea/free-mybatis-generator-config.xml
#	src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java
#	src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
#	src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
#	src/main/java/com/goafanti/common/model/PublicRelease.java
#	src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
anderx лет назад: 4
Родитель
Сommit
39b398d1f0
52 измененных файлов с 3756 добавлено и 2967 удалено
  1. 19 18
      .idea/free-mybatis-generator-config.xml
  2. 3 19
      src/main/java/com/goafanti/admin/controller/AdminSuperviserApiController.java
  3. 2 36
      src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java
  4. 12 10
      src/main/java/com/goafanti/common/bo/EmailBo.java
  5. 10 0
      src/main/java/com/goafanti/common/bo/paymentNodeEmailBo.java
  6. 4 2
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  7. 0 2
      src/main/java/com/goafanti/common/controller/BaseApiController.java
  8. 0 1
      src/main/java/com/goafanti/common/controller/BaseController.java
  9. 0 2
      src/main/java/com/goafanti/common/controller/PublicController.java
  10. 118 174
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  11. 6 14
      src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java
  12. 561 775
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  13. 60 52
      src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml
  14. 1 1
      src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml
  15. 7 6
      src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml
  16. 248 196
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  17. 1344 949
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  18. 15 13
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  19. 1 1
      src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml
  20. 4 2
      src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml
  21. 9 6
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  22. 316 310
      src/main/java/com/goafanti/common/model/Admin.java
  23. 405 184
      src/main/java/com/goafanti/common/model/PublicRelease.java
  24. 67 78
      src/main/java/com/goafanti/common/task/OrderDunTask.java
  25. 0 15
      src/main/java/com/goafanti/common/utils/DateUtils.java
  26. 3 2
      src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java
  27. 20 0
      src/main/java/com/goafanti/customer/bo/FollowListBo.java
  28. 7 1
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  29. 2 1
      src/main/java/com/goafanti/customer/service/CustomerService.java
  30. 10 2
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  31. 10 0
      src/main/java/com/goafanti/order/bo/InputArrearsDunListBo.java
  32. 4 4
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  33. 0 3
      src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java
  34. 3 12
      src/main/java/com/goafanti/order/controller/ProjectStatisticsApiController.java
  35. 2 2
      src/main/java/com/goafanti/order/service/OrderNewService.java
  36. 2 1
      src/main/java/com/goafanti/order/service/ProjectStatisticsService.java
  37. 8 0
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  38. 26 15
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  39. 1 1
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  40. 39 17
      src/main/java/com/goafanti/order/service/impl/ProjectStatisticsServiceImpl.java
  41. 193 0
      src/main/java/com/goafanti/order/service/impl/PushOrderService.java
  42. 0 1
      src/main/java/com/goafanti/patent/controller/AdminPatentNewApiController.java
  43. 9 10
      src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java
  44. 64 0
      src/main/java/com/goafanti/user/bo/outUserFollowList.java
  45. 30 3
      src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java
  46. 50 2
      src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java
  47. 15 1
      src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java
  48. 1 0
      src/main/java/com/goafanti/weChat/service/PublicReleaseService.java
  49. 41 18
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  50. 1 1
      src/main/resources/props/config_local.properties
  51. 1 1
      src/main/resources/props/config_test.properties
  52. 2 3
      src/main/webapp/WEB-INF/views/common.html

+ 19 - 18
.idea/free-mybatis-generator-config.xml

@@ -3,68 +3,69 @@
   <component name="PersistentConfig">
     <option name="historyConfigList">
       <map>
-        <entry key="public_release">
+        <entry key="admin">
           <value>
             <Config>
               <option name="comment" value="true" />
               <option name="daoMvnPath" value="src/main/java" />
-              <option name="daoName" value="PublicReleaseMapper" />
+              <option name="daoName" value="AdminMapper" />
               <option name="daoPackage" value="com.goafanti.common.dao" />
               <option name="daoPostfix" value="Mapper" />
               <option name="modelMvnPath" value="src/main/java" />
-              <option name="modelName" value="PublicRelease" />
+              <option name="modelName" value="Admin" />
               <option name="modelPackage" value="com.goafanti.common.model" />
-              <option name="name" value="public_release" />
+              <option name="name" value="admin" />
               <option name="overrideJava" value="true" />
               <option name="overrideXML" value="true" />
-              <option name="primaryKey" value="id" />
+              <option name="primaryKey" value="" />
               <option name="projectFolder" value="$PROJECT_DIR$" />
-              <option name="tableName" value="public_release" />
+              <option name="tableName" value="admin" />
               <option name="useSchemaPrefix" value="true" />
               <option name="xmlMvnPath" value="src/main/java" />
               <option name="xmlPackage" value="com.goafanti.common.mapper" />
             </Config>
           </value>
         </entry>
-        <entry key="public_release_count">
+        <entry key="organization_identity">
           <value>
             <Config>
               <option name="comment" value="true" />
               <option name="daoMvnPath" value="src/main/java" />
-              <option name="daoName" value="PublicReleaseCountMapper" />
+              <option name="daoName" value="OrganizationIdentityMapper" />
               <option name="daoPackage" value="com.goafanti.common.dao" />
               <option name="daoPostfix" value="Mapper" />
               <option name="modelMvnPath" value="src/main/java" />
-              <option name="modelName" value="PublicReleaseCount" />
+              <option name="modelName" value="OrganizationIdentity" />
               <option name="modelPackage" value="com.goafanti.common.model" />
-              <option name="name" value="public_release_count" />
+              <option name="name" value="organization_identity" />
               <option name="overrideJava" value="true" />
               <option name="overrideXML" value="true" />
-              <option name="primaryKey" value="id" />
+              <option name="primaryKey" value="" />
               <option name="projectFolder" value="$PROJECT_DIR$" />
-              <option name="tableName" value="public_release_count" />
+              <option name="tableName" value="organization_identity" />
+              <option name="useSchemaPrefix" value="true" />
               <option name="xmlMvnPath" value="src/main/java" />
               <option name="xmlPackage" value="com.goafanti.common.mapper" />
             </Config>
           </value>
         </entry>
-        <entry key="t_order_new">
+        <entry key="public_release">
           <value>
             <Config>
               <option name="comment" value="true" />
               <option name="daoMvnPath" value="src/main/java" />
-              <option name="daoName" value="TOrderNewMapper" />
+              <option name="daoName" value="PublicReleaseMapper" />
               <option name="daoPackage" value="com.goafanti.common.dao" />
               <option name="daoPostfix" value="Mapper" />
               <option name="modelMvnPath" value="src/main/java" />
-              <option name="modelName" value="TOrderNew" />
+              <option name="modelName" value="PublicRelease" />
               <option name="modelPackage" value="com.goafanti.common.model" />
-              <option name="name" value="t_order_new" />
+              <option name="name" value="public_release" />
               <option name="overrideJava" value="true" />
               <option name="overrideXML" value="true" />
-              <option name="primaryKey" value="order_no" />
+              <option name="primaryKey" value="id" />
               <option name="projectFolder" value="$PROJECT_DIR$" />
-              <option name="tableName" value="t_order_new" />
+              <option name="tableName" value="public_release" />
               <option name="useSchemaPrefix" value="true" />
               <option name="xmlMvnPath" value="src/main/java" />
               <option name="xmlPackage" value="com.goafanti.common.mapper" />

+ 3 - 19
src/main/java/com/goafanti/admin/controller/AdminSuperviserApiController.java

@@ -85,33 +85,27 @@ public class AdminSuperviserApiController extends CertifyApiController {
 				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户名为空", "用户名"));
 				return res;
 			}
-
 			Admin a = newAdminService.selectByMobile(admin.getMobile().trim());
 			if (null != a) {
 				res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "当前用户已注册!"));
 				return res;
 			}
 			if (newAdminService.checkAdminRole(roles,null)) {
-				res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "", "咨询师管理员"));				
-				return res;	
+				res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "", "咨询师管理员"));
+				return res;
 			}
-			
-
 			Admin ad = new Admin();
 			BeanUtils.copyProperties(admin, ad);
 			/*ad.setId(UUID.randomUUID().toString());*/
 			Calendar now = Calendar.getInstance();
 			now.set(Calendar.MILLISECOND, 0);
-
 			ad.setCreateTime(now.getTime());
 			if (StringUtils.isBlank(ad.getPassword())) {
 				ad.setPassword(AFTConstants.INITIALPASSWORD);
 			}
 			ad.setPassword(passwordUtil.getEncryptPwd(ad));
-			
 			res.setData(newAdminService.insertNewAdmin(ad,roles));
 		}
-
 		return res;
 	}
 
@@ -130,22 +124,18 @@ public class AdminSuperviserApiController extends CertifyApiController {
 		}
 		if (null != jo) {
 			Admin admin = jo.toJavaObject(Admin.class);
-
 			if (null == admin.getId()) {
 				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
 				return res;
 			}
-
 			if (null == admin.getMobile()) {
 				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "登录帐号为空", "登录帐号"));
 				return res;
 			}
-
 			if (null == admin.getName()) {
 				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户名为空", "用户名"));
 				return res;
 			}
-
 			Admin aa = newAdminService.selectByMobile(admin.getMobile().trim());
 			if (null != aa && !admin.getId().equals(aa.getId())) {
 				res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "当前用户已注册!"));
@@ -156,7 +146,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
 				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));				
 				return res;	
 			}	
-			
 			if (newAdminService.checkAdminRole(roles,admin)) {
 				res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "", "咨询师管理员"));				
 				return res;	
@@ -169,10 +158,8 @@ public class AdminSuperviserApiController extends CertifyApiController {
 			}
 		res.setData(newAdminService.updateByPrimaryKeySelective(ad, roles));
 		}
-		
-	
 		return res;
-}
+	}
 
 	/**
 	 * 重置管理员密码
@@ -184,7 +171,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
 			return res;
 		}
-
 		Admin admin = newAdminService.selectByPrimaryKey(id);
 		if (null == admin) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
@@ -220,7 +206,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
 				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "省份为空", "所在省份"));
 				return res;
 			}
-
 			if (province.intValue() > AFTConstants.PROVINCEMAXNUM) {
 				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "所在省份"));
 				return res;
@@ -322,7 +307,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
 	
 	/**
 	 * 查询下级或平级
-	 * @param subOrSame
 	 * @return
 	 */
 	@RequestMapping(value = "/selectAdminByOrg",method = RequestMethod.GET)

+ 2 - 36
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -46,9 +46,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		if(StringUtils.isNotBlank(alb.getStatus())) params.put("status", alb.getStatus());
 		if(StringUtils.isNotBlank(alb.getMobile())) params.put("mobile", alb.getMobile());
 		if(StringUtils.isNotBlank(alb.getSuperiorId())) params.put("superiorId", alb.getSuperiorId());		
-		@SuppressWarnings("unchecked")
 		Pagination<AdminListBo> p=(Pagination<AdminListBo>)findPage("selectAdminListByPage","selectAdminCount",params,pageNo,pageSize);
-		@SuppressWarnings("unchecked")
 		List<AdminListBo> list=(List<AdminListBo>)p.getList();
 		for(AdminListBo i:list){
 			i.setRoles(adminMapper.selectRolesByUid(i.getId()));
@@ -213,32 +211,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		ad.setStatus("正常");
 		ad.setId(UUID.randomUUID().toString());
 		ad.setType(sumType(roleIds));
-		/*String sdepNo=adminMapper.selectUserNoBySuperiorId(ad.getSuperiorId());
-		int Count=adminMapper.selectCountBySuperiorId(ad.getSuperiorId());
-		if(Count<10){
-			String dep=sdepNo+"0"+Count;
-			String sid=adminMapper.selectIdByUserNo(dep);
-			while(sid!=null){
-				Count=Count+1;				
-				if(Count>=10){
-					dep=sdepNo+Count;	
-				}else{
-					dep=sdepNo+"0"+Count;
-				}
-				sid=adminMapper.selectIdByUserNo(dep);				
-			}
-			ad.setUserNo(dep);
-		}
-		if(Count>=10){
-			String dep=sdepNo+Count;
-			String sid=adminMapper.selectIdByUserNo(dep);
-			while(sid!=null){
-				Count=Count+1;				
-				dep=sdepNo+Count;
-				sid=adminMapper.selectIdByUserNo(dep);				
-			}
-			ad.setUserNo(dep);
-		}	*/	
+
 		Map<String, Object> params = new HashMap<>();
 		params.put("uid", ad.getId());
 		params.put("roles", roleIds);
@@ -250,7 +223,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 			}
 			TokenManager.clearUserAuthByUserId(ad.getId());
 		}
-		return adminMapper.insertn(ad);
+		return adminMapper.insert(ad);
 	}
 
 	@Override
@@ -284,13 +257,6 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 	@Override
 	public Admin selectAllByid(String id) {
 		Admin admin=adminMapper.selectAllByid(id);
-		admin.setSuperior(adminMapper.selectNameByid(admin.getSuperiorId()));
-		if(admin.getDistrict()==null){
-			admin.setDistrict(" ");
-		}
-		if(admin.getHeadPortraitUrl()==null){
-			admin.setHeadPortraitUrl("");
-		}
 		return admin;
 	}
 

+ 12 - 10
src/main/java/com/goafanti/common/bo/EmailBo.java

@@ -36,8 +36,6 @@ public class EmailBo {
 	 * @param addressee
 	 * @param deptname
 	 * @param sender
-	 * @param userName
-	 * @param adminName
 	 * @param patentName
 	 * @param patentNo
 	 * @param amount
@@ -66,6 +64,7 @@ public class EmailBo {
 	 * @param sender		发起人
 	 * @param content		内容
 	 * @param orderNo		订单编号
+	 * @param contractNo	合同编号
 	 * @param date			时间
 	 * @param adminName		接收人名字
 	 * @param userName		用户名称
@@ -74,7 +73,7 @@ public class EmailBo {
 	 * @return 
 	 */
 	public  EmailBo(String subject, String address, String deptname, String sender,
-			String content , String orderNo,String date ,String dunStatusName,String adminName,String userName,Integer type,Integer approval) {
+			String content , String orderNo,String contractNo,String date ,String dunStatusName,String adminName,String userName,Integer type,Integer approval) {
 		if(approval !=null&&approval!=0)this.subject = "[特批]"+subject;
 		else this.subject = subject;
 		this.address = address;
@@ -82,8 +81,8 @@ public class EmailBo {
 		this.deptname = deptname;
 		this.sender = sender;
 		if(type==0)this.content = setGeneralFormat();
-		if(type==1)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,0);
-		if(type==2)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,1);
+		if(type==1)this.content=setDunFormat( addressee, sender, deptname,orderNo,contractNo, date , dunStatusName,adminName,userName,0);
+		if(type==2)this.content=setDunFormat( addressee, sender, deptname,orderNo,contractNo, date , dunStatusName,adminName,userName,1);
 	}
 	
 	/**
@@ -122,7 +121,7 @@ public class EmailBo {
 	
 
 
-	public String setDunFormat(String addressee,String sender,String deptname,String orderNo,String date ,String dunStatusName,String adminName,
+	public String setDunFormat(String addressee,String sender,String deptname,String orderNo,String contractNo,String date ,String dunStatusName,String adminName,
 			String userName,int i) {
 		String str1 = "",str2= "",str3= "";
 		if (i==0) str1="催收时间";str2="催收科目";str3="催收状态";
@@ -172,10 +171,13 @@ public class EmailBo {
 				"              </tr>\r\n" + 
 				"              <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">客户名称:"+userName+"</td>\r\n" + 
-				"              </tr>\r\n" + 
-				"               <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">订单编号:"+orderNo+"</td>\r\n" + 
-				"              </tr>\r\n" + 
+				"              </tr>\r\n" +
+				"               <tr>\r\n" +
+				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">订单编号:"+orderNo+"</td>\r\n" +
+				"              </tr>\r\n" +
+				"               <tr>\r\n" +
+				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">合同编号:"+contractNo+"</td>\r\n" +
+				"              </tr>\r\n" +
 				"               <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">"+str1+":"+date+"</td>\r\n" + 
 				"              </tr>\r\n" + 

+ 10 - 0
src/main/java/com/goafanti/common/bo/paymentNodeEmailBo.java

@@ -6,7 +6,17 @@ public class paymentNodeEmailBo {
 	private String salesmanName;
 	private String email;
 	private String orderNo;
+	private String contractNo;
 	private String userName;
+
+	public String getContractNo() {
+		return contractNo;
+	}
+
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+
 	public String getSalesmanId() {
 		return salesmanId;
 	}

+ 4 - 2
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -42,9 +42,11 @@ public class AFTConstants {
 	/**	营销员 */
 	public static final String  SALESMAN                      		= "96";					
 	/**	外包审核员 */
-	public static final String  OUTSOURCE_AUDITOR                   = "9991";				
+	public static final String  OUTSOURCE_AUDITOR                   = "9991";
 	/** 专利管理员 */
-	public static final String  PATENT_AUDITOR 	                  	= "9992";				
+	public static final String  PATENT_AUDITOR 	                  	= "9992";
+	/** 公司管理 */
+	public static final String  COMPANY_MANAGER 	                = "9993";
 	/** 渠道专员 */
 	public static final String  CHANNEL                      		= "80";		
 	/** 渠道总监 */

+ 0 - 2
src/main/java/com/goafanti/common/controller/BaseApiController.java

@@ -80,10 +80,8 @@ public class BaseApiController extends BaseController {
 	/**
 	 * 
 	 * @param res
-	 * @param path
 	 * @param isPrivate
 	 * @param req
-	 * @param sign
 	 * @return
 	 */
 	protected String handleFile(Result res, boolean isPrivate, HttpServletRequest req, String... fileName) {

+ 0 - 1
src/main/java/com/goafanti/common/controller/BaseController.java

@@ -126,7 +126,6 @@ public class BaseController {
 			model.addAttribute("userData", TokenManager.getUserToken());
 			model.addAttribute("userName", TokenManager.getUserToken().getNickname());
 		}
-
 		if (TokenManager.isLogin() && TokenManager.getToken() instanceof Admin) {
 			model.addAttribute("adminData", TokenManager.getAdminToken());
 			model.addAttribute("userName", TokenManager.getAdminToken().getName());

+ 0 - 2
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -304,11 +304,9 @@ public class PublicController extends CertifyApiController {
 	/**
 	 * 下载文件
 	 * 
-	 * @param res
 	 * @param fileName
 	 * @param response
 	 * @param path
-	 * @param request
 	 * @return
 	 */
 	@RequestMapping(value = "/downloadFile", method = RequestMethod.GET)

+ 118 - 174
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -1,203 +1,147 @@
 package com.goafanti.common.dao;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-
 import com.goafanti.admin.bo.AdminContacts;
 import com.goafanti.admin.bo.AdminListBo;
-import com.goafanti.app.bo.AppAdminListBo;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Role;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.common.model.AdminExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface AdminMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(Admin record);
+
+    int insertSelective(Admin record);
+
+    Admin selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(Admin record);
+
+    int updateByPrimaryKey(Admin record);
+    Admin selectByMobile(String mobile);
+
+    List<Role> selectRolesByPrimaryKey(String uid);
+
+    List<Admin> selectCognizanceConsultant();
+
+    List<Admin> selectCognizancePrincipal();
+
+    List<Admin> selectPatentAuthor();
+
+    List<Admin> selectPatentPrincipal();
+
+    List<Admin> selectCopyrightConsultant();
+
+    List<Admin> selectCopyrightPrincipal();
+
+    List<Admin> selectTechprojectConsultant();
+
+    List<Admin> selectTechprojectPrincipal();
+
+    List<String> selectRoleByPrimaryKey(String uid);
+
+    List<Admin> selectAccoutManager();
+
+    List<Admin> selectTechnician();
+
+    List<Admin> selectSalesman();
+
+    List<Admin> selectContractManager();
+
+    List<Admin> selectTechBroder();
+
+    List<Admin> listAdminSelectBySuperAdmin();
+
+    List<Admin> listAdminSelectByAreaAdmin(@Param("provinceList")List<Integer> provinceList, @Param("cityList")List<Integer> cityList);
+
+    List<Admin> listAdminByName(@Param("name")String name);
+
+
+    int insertn(Admin record);
+
+    String selectUserNoBySuperiorId(String superiorId);
+
+    int selectCountBySuperiorId(String superiorId);
+
+    String selectIdByUserNo(String userNo);
+
+    Admin selectAllByid(@Param("id") String id);
+
+    String selectNameByid(String id);
+
+    List<String>selectRolesByUid(String id);
+
+    List<String>selectRolesIdByUid(String id);
+
+    String selectStatusByMobile(@Param("mobile")String mobile);
+
+    int deleteById(String id);
+
+    List<Admin> selectIDNBySuperiorId(String superiorId);
+
+    String selectUserNoById(String superiorId);
+
+    int updateByUserNo(Admin record);
+
+    List<String>selectIdBySuperiorId(String superiorId);
+
+    /**
+     * 查询下级人员
+     * @param adminId
+     * @return
+     */
+    List<AdminListBo> selectSubList(@Param("adminId")String adminId);
+
+    /**
+     * @return
+     */
+    Admin selectAdminByRoleId(@Param("roleId")String roleId);
     /**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	long countByExample(AdminExample example);
+     * 查询部门下的员工
+     * @param departmentId
+     * @param name
+     * @return
+     */
+    List<AdminListBo> selectDepartmentStaff(String departmentId, String name);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int deleteByExample(AdminExample example);
+    Admin selectAdminName(@Param("name")String name);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int deleteByPrimaryKey(String id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int insert(Admin record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int insertSelective(Admin record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	List<Admin> selectByExample(AdminExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	Admin selectByPrimaryKey(String id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int updateByPrimaryKeySelective(Admin record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table admin
-	 * @mbg.generated  Fri Jun 22 14:12:55 CST 2018
-	 */
-	int updateByPrimaryKey(Admin record);
-
-	Admin selectByMobile(String mobile);
-
-	List<Role> selectRolesByPrimaryKey(String uid);
-
-	List<Admin> selectCognizanceConsultant();
-	
-	List<Admin> selectCognizancePrincipal();
-
-	List<Admin> selectPatentAuthor();
-
-	List<Admin> selectPatentPrincipal();
-
-	List<Admin> selectCopyrightConsultant();
-
-	List<Admin> selectCopyrightPrincipal();
-
-	List<Admin> selectTechprojectConsultant();
-
-	List<Admin> selectTechprojectPrincipal();
-
-	List<String> selectRoleByPrimaryKey(String uid);
-
-	List<Admin> selectAccoutManager();
-
-	List<Admin> selectTechnician();
-
-	List<Admin> selectSalesman();
-
-	List<Admin> selectContractManager();
-
-	List<Admin> selectTechBroder();
-
-	List<Admin> listAdminSelectBySuperAdmin();
-
-	List<Admin> listAdminSelectByAreaAdmin(@Param("provinceList")List<Integer> provinceList, @Param("cityList")List<Integer> cityList);
-	
-	List<Admin> listAdminByName(@Param("name")String name);
-	
-	
-	int insertn(Admin record);
-	
-	String selectUserNoBySuperiorId(String superiorId);
-	
-	int selectCountBySuperiorId(String superiorId);
-	
-	String selectIdByUserNo(String userNo);
-	
-	Admin selectAllByid(String id);
-	
-	String selectNameByid(String id);
-	
-	List<String>selectRolesByUid(String id);
-	
-	List<String>selectRolesIdByUid(String id);
-	
-	String selectStatusByMobile(@Param("mobile")String mobile);
-	
-	int deleteById(String id);
+    List<Admin> selectAllAdmin(@Param("depId")String depId);
 
-	List<Admin> selectIDNBySuperiorId(String superiorId);
-	
-	String selectUserNoById(String superiorId);
-	
-	int updateByUserNo(Admin record);
-	
-	List<String>selectIdBySuperiorId(String superiorId);
-	
-	/**
-	 * 查询下级人员
-	 * @param adminId
-	 * @return
-	 */
-	List<AdminListBo> selectSubList(@Param("adminId")String adminId);
-	
-	/**
-	 * @return
-	 */
-	Admin selectAdminByRoleId(@Param("roleId")String roleId);
-	/**
-	 * 查询部门下的员工
-	 * @param departmentId
-	 * @param name
-	 * @return
-	 */
-	List<AdminListBo> selectDepartmentStaff(String departmentId, String name);
-	
-	Admin selectAdminName(@Param("name")String name);
+    int updateLockIds(@Param("lockIds")String lockIds);
 
-	List<Admin> selectAllAdmin(@Param("depId")String depId);
 
-	int updateLockIds(@Param("lockIds")String lockIds);
+    int getCountById(String id);
+    AdminListBo getDeptNameByAid(String id);
 
+    List<Admin> getAdminRoleList(String roleName);
 
-	int getCountById(String id);
-	AdminListBo getDeptNameByAid(String id);
+    int addAdminContacts(AdminContacts a);
 
-	List<Admin> getAdminRoleList(String roleName);
+    int deleteFrequentContacts(String id);
 
-	int addAdminContacts(AdminContacts a);
+    List<String> getaidFrequentContacts(String id);
 
-	int deleteFrequentContacts(String id);
+    List<String> listNameByDepAndName(@Param("depId")String depId,@Param("roleName")String roleName);
 
-	List<String> getaidFrequentContacts(String id);
+    List<String> selectBySuperId(String aid);
 
-	List<String> listNameByDepAndName(@Param("depId")String depId,@Param("roleName")String roleName);
+    Admin selectFinanceAdminByOrderDep(String orderDep);
 
-	List<String> selectBySuperId(String aid);
+    String getPermission(String transferId);
 
-	Admin selectFinanceAdminByOrderDep(String orderDep);
+    List<String> selectDepIdWithSpuerId(String superId);
 
-	String getPermission(String transferId);
 
-	List<String> selectDepIdWithSpuerId(String superId);
+    List<String> getAdminRoleListByAid(String id);
 
+    Admin selectByOpeid(String openid);
 
-	List<String> getAdminRoleListByAid(String id);
+    Admin selectGetSuper(String aid);
 
-	Admin selectByOpeid(String openid);
+    List<String> getFinanceDep(String aid);
 
-	Admin selectGetSuper(String aid);
-	
-}
+    List<String> getLowerFinanceDep(String aid);
+}

+ 6 - 14
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -1,15 +1,10 @@
 package com.goafanti.common.dao;
 
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-import com.goafanti.common.model.PublicReleaseCount;
-import com.goafanti.common.model.outUserFollowCount;
-import org.apache.ibatis.annotations.Param;
-
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.weChat.bo.OutPublicRelease;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
 
 public interface PublicReleaseMapper {
     int deleteByPrimaryKey(Integer id);
@@ -24,13 +19,10 @@ public interface PublicReleaseMapper {
 
     int updateByPrimaryKey(PublicRelease record);
 
-	void insertSelectiveGetId(PublicRelease in);
-
-	OutPublicRelease selectDtails(@Param("id") Integer id,@Param("ufid")String ufid);
+    void insertSelectiveGetId(PublicRelease in);
 
-	int checkTime(@Param("aid")String aid,@Param("start")Date start, @Param("end")Date end);
+    OutPublicRelease selectDtails(@Param("id") Integer id, @Param("ufid")String ufid);
 
-    void updateSignByAidAndUid(@Param("uid") String buyerId, @Param("aid") String salesmanId);
+    int checkTime(@Param("aid")String aid, @Param("start") Date start, @Param("end")Date end);
 
-    List<PublicReleaseCount> getTimeUserFollow(@Param("date")Date date, @Param("now")Date now);
 }

Разница между файлами не показана из-за своего большого размера
+ 561 - 775
src/main/java/com/goafanti/common/mapper/AdminMapper.xml


+ 60 - 52
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -101,61 +101,66 @@
     delete from organization_identity
     where id = #{id,jdbcType=VARCHAR}
   </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.OrganizationIdentity" useGeneratedKeys="true">
-    insert into organization_identity (`uid`, contacts, contact_mobile, 
-      fixed_tel, qq, postal_address, 
-      postcode, unit_name, registered_capital, 
-      licence_number, licence_province, licence_city, 
-      licence_area, licence_scanning_url, org_code, 
-      org_code_url, bank_account, banks, 
-      bank_branch, bank_card_number, validation_amount, 
-      identity_type, location_province, location_city, 
-      location_area, legal_person, legal_person_id_card, 
-      last_year_tax_report_url, audit_status, `process`, 
-      wrong_count, payment_date, listed, 
-      listed_date, listed_type, stock_code, 
-      certificate_number, issuing_date, cog_contacts, 
-      tech_principal, contacts_fixed_tel, contacts_fax, 
-      legal_person_tel, legal_person_fax, legal_person_email, 
-      registration_time, ratepay_code, industry, 
-      enterprise_scale, register_type, foreign_investment, 
-      field, tax_authority, ratepay_method, 
-      high_tech_zone, risk_investment, business_scope, 
-      high_tech_name, patent_prory_statement_url, 
-      international, review_instructions, investment, 
-      year_sales_amount, last_year_research_amount, 
-      assets, qualification, cooperation_situation, 
-      honor_picture, sales_target, intended_project, 
-      contacts_dep, contacts_position)
-    values (#{uid,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, 
-      #{fixedTel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, #{postalAddress,jdbcType=VARCHAR}, 
-      #{postcode,jdbcType=VARCHAR}, #{unitName,jdbcType=VARCHAR}, #{registeredCapital,jdbcType=DECIMAL}, 
-      #{licenceNumber,jdbcType=VARCHAR}, #{licenceProvince,jdbcType=INTEGER}, #{licenceCity,jdbcType=INTEGER}, 
-      #{licenceArea,jdbcType=INTEGER}, #{licenceScanningUrl,jdbcType=VARCHAR}, #{orgCode,jdbcType=VARCHAR}, 
-      #{orgCodeUrl,jdbcType=VARCHAR}, #{bankAccount,jdbcType=VARCHAR}, #{banks,jdbcType=VARCHAR}, 
-      #{bankBranch,jdbcType=VARCHAR}, #{bankCardNumber,jdbcType=VARCHAR}, #{validationAmount,jdbcType=DECIMAL}, 
-      #{identityType,jdbcType=INTEGER}, #{locationProvince,jdbcType=INTEGER}, #{locationCity,jdbcType=INTEGER}, 
-      #{locationArea,jdbcType=INTEGER}, #{legalPerson,jdbcType=VARCHAR}, #{legalPersonIdCard,jdbcType=VARCHAR}, 
-      #{lastYearTaxReportUrl,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{process,jdbcType=INTEGER}, 
-      #{wrongCount,jdbcType=INTEGER}, #{paymentDate,jdbcType=TIMESTAMP}, #{listed,jdbcType=INTEGER}, 
-      #{listedDate,jdbcType=TIMESTAMP}, #{listedType,jdbcType=INTEGER}, #{stockCode,jdbcType=VARCHAR}, 
-      #{certificateNumber,jdbcType=VARCHAR}, #{issuingDate,jdbcType=TIMESTAMP}, #{cogContacts,jdbcType=INTEGER}, 
-      #{techPrincipal,jdbcType=VARCHAR}, #{contactsFixedTel,jdbcType=VARCHAR}, #{contactsFax,jdbcType=VARCHAR}, 
-      #{legalPersonTel,jdbcType=VARCHAR}, #{legalPersonFax,jdbcType=VARCHAR}, #{legalPersonEmail,jdbcType=VARCHAR}, 
-      #{registrationTime,jdbcType=TIMESTAMP}, #{ratepayCode,jdbcType=VARCHAR}, #{industry,jdbcType=INTEGER}, 
-      #{enterpriseScale,jdbcType=VARCHAR}, #{registerType,jdbcType=VARCHAR}, #{foreignInvestment,jdbcType=VARCHAR}, 
-      #{field,jdbcType=VARCHAR}, #{taxAuthority,jdbcType=INTEGER}, #{ratepayMethod,jdbcType=INTEGER}, 
-      #{highTechZone,jdbcType=INTEGER}, #{riskInvestment,jdbcType=INTEGER}, #{businessScope,jdbcType=VARCHAR}, 
-      #{highTechName,jdbcType=VARCHAR}, #{patentProryStatementUrl,jdbcType=VARCHAR}, 
-      #{international,jdbcType=INTEGER}, #{reviewInstructions,jdbcType=VARCHAR}, #{investment,jdbcType=INTEGER}, 
-      #{yearSalesAmount,jdbcType=DECIMAL}, #{lastYearResearchAmount,jdbcType=DECIMAL}, 
-      #{assets,jdbcType=DECIMAL}, #{qualification,jdbcType=VARCHAR}, #{cooperationSituation,jdbcType=VARCHAR}, 
-      #{honorPicture,jdbcType=VARCHAR}, #{salesTarget,jdbcType=VARCHAR}, #{intendedProject,jdbcType=VARCHAR}, 
-      #{contactsDep,jdbcType=VARCHAR}, #{contactsPosition,jdbcType=VARCHAR})
+  <insert id="insert" parameterType="com.goafanti.common.model.OrganizationIdentity">
+    insert into organization_identity (id, `uid`, contacts, 
+      contact_mobile, fixed_tel, qq, 
+      postal_address, postcode, unit_name, 
+      registered_capital, licence_number, licence_province, 
+      licence_city, licence_area, licence_scanning_url, 
+      org_code, org_code_url, bank_account, 
+      banks, bank_branch, bank_card_number, 
+      validation_amount, identity_type, location_province, 
+      location_city, location_area, legal_person, 
+      legal_person_id_card, last_year_tax_report_url, 
+      audit_status, `process`, wrong_count, 
+      payment_date, listed, listed_date, 
+      listed_type, stock_code, certificate_number, 
+      issuing_date, cog_contacts, tech_principal, 
+      contacts_fixed_tel, contacts_fax, legal_person_tel, 
+      legal_person_fax, legal_person_email, registration_time, 
+      ratepay_code, industry, enterprise_scale, 
+      register_type, foreign_investment, field, 
+      tax_authority, ratepay_method, high_tech_zone, 
+      risk_investment, business_scope, high_tech_name, 
+      patent_prory_statement_url, international, 
+      review_instructions, investment, year_sales_amount, 
+      last_year_research_amount, assets, qualification, 
+      cooperation_situation, honor_picture, sales_target, 
+      intended_project, contacts_dep, contacts_position
+      )
+    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, 
+      #{contactMobile,jdbcType=VARCHAR}, #{fixedTel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, 
+      #{postalAddress,jdbcType=VARCHAR}, #{postcode,jdbcType=VARCHAR}, #{unitName,jdbcType=VARCHAR}, 
+      #{registeredCapital,jdbcType=DECIMAL}, #{licenceNumber,jdbcType=VARCHAR}, #{licenceProvince,jdbcType=INTEGER}, 
+      #{licenceCity,jdbcType=INTEGER}, #{licenceArea,jdbcType=INTEGER}, #{licenceScanningUrl,jdbcType=VARCHAR}, 
+      #{orgCode,jdbcType=VARCHAR}, #{orgCodeUrl,jdbcType=VARCHAR}, #{bankAccount,jdbcType=VARCHAR}, 
+      #{banks,jdbcType=VARCHAR}, #{bankBranch,jdbcType=VARCHAR}, #{bankCardNumber,jdbcType=VARCHAR}, 
+      #{validationAmount,jdbcType=DECIMAL}, #{identityType,jdbcType=INTEGER}, #{locationProvince,jdbcType=INTEGER}, 
+      #{locationCity,jdbcType=INTEGER}, #{locationArea,jdbcType=INTEGER}, #{legalPerson,jdbcType=VARCHAR}, 
+      #{legalPersonIdCard,jdbcType=VARCHAR}, #{lastYearTaxReportUrl,jdbcType=VARCHAR}, 
+      #{auditStatus,jdbcType=INTEGER}, #{process,jdbcType=INTEGER}, #{wrongCount,jdbcType=INTEGER}, 
+      #{paymentDate,jdbcType=TIMESTAMP}, #{listed,jdbcType=INTEGER}, #{listedDate,jdbcType=TIMESTAMP}, 
+      #{listedType,jdbcType=INTEGER}, #{stockCode,jdbcType=VARCHAR}, #{certificateNumber,jdbcType=VARCHAR}, 
+      #{issuingDate,jdbcType=TIMESTAMP}, #{cogContacts,jdbcType=INTEGER}, #{techPrincipal,jdbcType=VARCHAR}, 
+      #{contactsFixedTel,jdbcType=VARCHAR}, #{contactsFax,jdbcType=VARCHAR}, #{legalPersonTel,jdbcType=VARCHAR}, 
+      #{legalPersonFax,jdbcType=VARCHAR}, #{legalPersonEmail,jdbcType=VARCHAR}, #{registrationTime,jdbcType=TIMESTAMP}, 
+      #{ratepayCode,jdbcType=VARCHAR}, #{industry,jdbcType=INTEGER}, #{enterpriseScale,jdbcType=VARCHAR}, 
+      #{registerType,jdbcType=VARCHAR}, #{foreignInvestment,jdbcType=VARCHAR}, #{field,jdbcType=VARCHAR}, 
+      #{taxAuthority,jdbcType=INTEGER}, #{ratepayMethod,jdbcType=INTEGER}, #{highTechZone,jdbcType=INTEGER}, 
+      #{riskInvestment,jdbcType=INTEGER}, #{businessScope,jdbcType=VARCHAR}, #{highTechName,jdbcType=VARCHAR}, 
+      #{patentProryStatementUrl,jdbcType=VARCHAR}, #{international,jdbcType=INTEGER}, 
+      #{reviewInstructions,jdbcType=VARCHAR}, #{investment,jdbcType=INTEGER}, #{yearSalesAmount,jdbcType=DECIMAL}, 
+      #{lastYearResearchAmount,jdbcType=DECIMAL}, #{assets,jdbcType=DECIMAL}, #{qualification,jdbcType=VARCHAR}, 
+      #{cooperationSituation,jdbcType=VARCHAR}, #{honorPicture,jdbcType=VARCHAR}, #{salesTarget,jdbcType=VARCHAR}, 
+      #{intendedProject,jdbcType=VARCHAR}, #{contactsDep,jdbcType=VARCHAR}, #{contactsPosition,jdbcType=VARCHAR}
+      )
   </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.OrganizationIdentity" useGeneratedKeys="true">
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationIdentity">
     insert into organization_identity
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
       <if test="uid != null">
         `uid`,
       </if>
@@ -374,6 +379,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
       <if test="uid != null">
         #{uid,jdbcType=VARCHAR},
       </if>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -635,7 +635,7 @@
         from admin a left join (select x.aid,x.userCount,x.channelCount,signCount,x.newCount,x.channelNewCount,x.receiveCount,
         ifnull(y.completeCount,0)completeCount,ifnull(y.channelCompleteCount,0)channelCompleteCount
         from (select aid,sum(if( share_type=0 and channel=0,1,0))userCount,
-        sum(if(share_type=0 and  channel=1,1,0))channelCount,
+        sum(if(share_type=3 and  channel=1,1,0))channelCount,
         sum(if( share_type=2 ,1,0))signCount,
         sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
         sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,

+ 7 - 6
src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml

@@ -467,16 +467,17 @@
    </if>
   </select>
   <select id="selectByStatus" resultType="com.goafanti.organization.bo.OutPaymentNode">
-  select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime ,
-   party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
+    select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime ,
+   party_amount partyAmount,party_time partyTime, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
    from payment_node where dun_status = #{status}
   </select>
   
   <select id="selectBytidGetEmail" resultType="com.goafanti.common.bo.paymentNodeEmailBo">
-  select a.tid,b.order_no orderNo,c.salesman_id salesmanId,c.salesman_name salesmanName,c.buyer_name userName,d.email from payment_node a 
-left join t_order_task b on a.tid=b.id
-left join t_order_mid c on b.order_no=c.order_no left join admin d on  c.salesman_id=d.id
-where a.tid= #{tid} limit 1
+    select a.tid,b.order_no orderNo,o.contract_no contractNo ,c.salesman_id salesmanId, c.salesman_name salesmanName,
+           c.buyer_name userName,d.email
+    from payment_node a left join t_order_task b on a.tid=b.id left join t_order_new o on b.order_no =o.order_no
+    left join t_order_mid c on b.order_no=c.order_no left join admin d on  c.salesman_id=d.id
+    where a.tid= #{tid} limit 1
   </select>
   
    <select id="selectByTidAndCid" resultType="com.goafanti.organization.bo.OutPaymentNode">

+ 248 - 196
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -24,12 +24,14 @@
     <result column="valid_date" jdbcType="VARCHAR" property="validDate" />
     <result column="new_user" jdbcType="INTEGER" property="newUser" />
     <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
-    <result column="main_status" jdbcType="INTEGER" property="mainStatus" />
+    <result column="mian_status" jdbcType="INTEGER" property="mianStatus" />
+    <result column="supplement" jdbcType="VARCHAR" property="supplement" />
+    <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
   </resultMap>
   <sql id="Base_Column_List">
     id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude, 
     latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname, 
-    ufid, duration, valid_date, new_user, sign_sum, main_status
+    ufid, duration, valid_date, new_user, sign_sum, mian_status, supplement, audit_info
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
@@ -49,7 +51,8 @@
       clock_in_time, photo_url, pid, 
       pname, ufid, duration, 
       valid_date, new_user, sign_sum, 
-      main_status)
+      mian_status, supplement, audit_info
+      )
     values (#{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, 
       #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, 
       #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, 
@@ -57,7 +60,8 @@
       #{clockInTime,jdbcType=TIMESTAMP}, #{photoUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, 
       #{pname,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, 
       #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER}, 
-      #{mainStatus,jdbcType=INTEGER})
+      #{mianStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
     insert into public_release
@@ -125,8 +129,14 @@
       <if test="signSum != null">
         sign_sum,
       </if>
-      <if test="mainStatus != null">
-        main_status,
+      <if test="mianStatus != null">
+        mian_status,
+      </if>
+      <if test="supplement != null">
+        supplement,
+      </if>
+      <if test="auditInfo != null">
+        audit_info,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -193,8 +203,14 @@
       <if test="signSum != null">
         #{signSum,jdbcType=INTEGER},
       </if>
-      <if test="mainStatus != null">
-        #{mainStatus,jdbcType=INTEGER},
+      <if test="mianStatus != null">
+        #{mianStatus,jdbcType=INTEGER},
+      </if>
+      <if test="supplement != null">
+        #{supplement,jdbcType=VARCHAR},
+      </if>
+      <if test="auditInfo != null">
+        #{auditInfo,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -264,8 +280,14 @@
       <if test="signSum != null">
         sign_sum = #{signSum,jdbcType=INTEGER},
       </if>
-      <if test="mainStatus != null">
-        main_status = #{mainStatus,jdbcType=INTEGER},
+      <if test="mianStatus != null">
+        mian_status = #{mianStatus,jdbcType=INTEGER},
+      </if>
+      <if test="supplement != null">
+        supplement = #{supplement,jdbcType=VARCHAR},
+      </if>
+      <if test="auditInfo != null">
+        audit_info = #{auditInfo,jdbcType=VARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
@@ -293,169 +315,178 @@
       valid_date = #{validDate,jdbcType=VARCHAR},
       new_user = #{newUser,jdbcType=INTEGER},
       sign_sum = #{signSum,jdbcType=INTEGER},
-      main_status = #{mainStatus,jdbcType=INTEGER}
+      mian_status = #{mianStatus,jdbcType=INTEGER},
+      supplement = #{supplement,jdbcType=VARCHAR},
+      audit_info = #{auditInfo,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  <update id="updateSignByAidAndUid">
-    update public_release a ,(select max(create_time)create_time from public_release
-      where aid= #{aid} and uid=#{uid} and main_status =1 group by aid,uid)b
-    set a.sign_sum =a.sign_sum +1
-    where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
-  </update>
-  <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
-    insert into public_release
-      <trim prefix="(" suffix=")" suffixOverrides=",">
-        <if test="uid != null">
-          `uid`,
-        </if>
-        <if test="aid != null">
-          aid,
-        </if>
-        <if test="releaseStart != null">
-          release_start,
-        </if>
-        <if test="releaseEnd != null">
-          release_end,
-        </if>
-        <if test="remarks != null">
-          remarks,
-        </if>
-        <if test="annexUrl != null">
-          annex_url,
-        </if>
-        <if test="userName != null">
-          user_name,
-        </if>
-        <if test="longitude != null">
-          longitude,
-        </if>
-        <if test="latitude != null">
-          latitude,
-        </if>
-        <if test="status != null">
-          `status`,
-        </if>
-        <if test="createTime != null">
-          create_time,
-        </if>
-        <if test="clockIn != null">
-          clock_in,
-        </if>
-        <if test="clockInTime != null">
-          clock_in_time,
-        </if>
-        <if test="photoUrl != null">
-          photo_url,
-        </if>
-        <if test="pid != null">
-          pid,
-        </if>
-        <if test="pname != null">
-          pname,
-        </if>
-        <if test="ufid != null">
-          ufid,
-        </if>
-        <if test="duration != null">
-          duration,
-        </if>
-        <if test="validDate != null">
-          valid_date,
-        </if>
-        <if test="newUser != null">
-          new_user,
-        </if>
-        <if test="signSum != null">
-          sign_sum,
-        </if>
-        <if test="mainStatus != null">
-          main_status,
-        </if>
-      </trim>
-      <trim prefix="values (" suffix=")" suffixOverrides=",">
-        <if test="uid != null">
-          #{uid,jdbcType=VARCHAR},
-        </if>
-        <if test="aid != null">
-          #{aid,jdbcType=VARCHAR},
-        </if>
-        <if test="releaseStart != null">
-          #{releaseStart,jdbcType=TIMESTAMP},
-        </if>
-        <if test="releaseEnd != null">
-          #{releaseEnd,jdbcType=TIMESTAMP},
-        </if>
-        <if test="remarks != null">
-          #{remarks,jdbcType=VARCHAR},
-        </if>
-        <if test="annexUrl != null">
-          #{annexUrl,jdbcType=VARCHAR},
-        </if>
-        <if test="userName != null">
-          #{userName,jdbcType=VARCHAR},
-        </if>
-        <if test="longitude != null">
-          #{longitude,jdbcType=VARCHAR},
-        </if>
-        <if test="latitude != null">
-          #{latitude,jdbcType=VARCHAR},
-        </if>
-        <if test="status != null">
-          #{status,jdbcType=INTEGER},
-        </if>
-        <if test="createTime != null">
-          #{createTime,jdbcType=TIMESTAMP},
-        </if>
-        <if test="clockIn != null">
-          #{clockIn,jdbcType=INTEGER},
-        </if>
-        <if test="clockInTime != null">
-          #{clockInTime,jdbcType=TIMESTAMP},
-        </if>
-        <if test="photoUrl != null">
-          #{photoUrl,jdbcType=VARCHAR},
-        </if>
-        <if test="pid != null">
-          #{pid,jdbcType=VARCHAR},
-        </if>
-        <if test="pname != null">
-          #{pname,jdbcType=VARCHAR},
-        </if>
-        <if test="ufid != null">
-          #{ufid,jdbcType=VARCHAR},
-        </if>
-        <if test="duration != null">
-          #{duration,jdbcType=DOUBLE},
-        </if>
-        <if test="validDate != null">
-          #{validDate,jdbcType=VARCHAR},
-        </if>
-        <if test="newUser != null">
-          #{newUser,jdbcType=INTEGER},
-        </if>
-        <if test="signSum != null">
-          #{signSum,jdbcType=INTEGER},
-        </if>
-        <if test="mainStatus != null">
-          #{mainStatus,jdbcType=INTEGER},
-        </if>
-      </trim>
+
+   <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
+     insert into public_release
+     <trim prefix="(" suffix=")" suffixOverrides=",">
+       <if test="uid != null">
+         `uid`,
+       </if>
+       <if test="aid != null">
+         aid,
+       </if>
+       <if test="releaseStart != null">
+         release_start,
+       </if>
+       <if test="releaseEnd != null">
+         release_end,
+       </if>
+       <if test="remarks != null">
+         remarks,
+       </if>
+       <if test="annexUrl != null">
+         annex_url,
+       </if>
+       <if test="userName != null">
+         user_name,
+       </if>
+       <if test="longitude != null">
+         longitude,
+       </if>
+       <if test="latitude != null">
+         latitude,
+       </if>
+       <if test="status != null">
+         `status`,
+       </if>
+       <if test="createTime != null">
+         create_time,
+       </if>
+       <if test="clockIn != null">
+         clock_in,
+       </if>
+       <if test="clockInTime != null">
+         clock_in_time,
+       </if>
+       <if test="photoUrl != null">
+         photo_url,
+       </if>
+       <if test="pid != null">
+         pid,
+       </if>
+       <if test="pname != null">
+         pname,
+       </if>
+       <if test="ufid != null">
+         ufid,
+       </if>
+       <if test="duration != null">
+         duration,
+       </if>
+       <if test="validDate != null">
+         valid_date,
+       </if>
+       <if test="newUser != null">
+         new_user,
+       </if>
+       <if test="signSum != null">
+         sign_sum,
+       </if>
+       <if test="mianStatus != null">
+         mian_status,
+       </if>
+       <if test="supplement != null">
+         supplement,
+       </if>
+       <if test="auditInfo != null">
+         audit_info,
+       </if>
+     </trim>
+     <trim prefix="values (" suffix=")" suffixOverrides=",">
+       <if test="uid != null">
+         #{uid,jdbcType=VARCHAR},
+       </if>
+       <if test="aid != null">
+         #{aid,jdbcType=VARCHAR},
+       </if>
+       <if test="releaseStart != null">
+         #{releaseStart,jdbcType=TIMESTAMP},
+       </if>
+       <if test="releaseEnd != null">
+         #{releaseEnd,jdbcType=TIMESTAMP},
+       </if>
+       <if test="remarks != null">
+         #{remarks,jdbcType=VARCHAR},
+       </if>
+       <if test="annexUrl != null">
+         #{annexUrl,jdbcType=VARCHAR},
+       </if>
+       <if test="userName != null">
+         #{userName,jdbcType=VARCHAR},
+       </if>
+       <if test="longitude != null">
+         #{longitude,jdbcType=VARCHAR},
+       </if>
+       <if test="latitude != null">
+         #{latitude,jdbcType=VARCHAR},
+       </if>
+       <if test="status != null">
+         #{status,jdbcType=INTEGER},
+       </if>
+       <if test="createTime != null">
+         #{createTime,jdbcType=TIMESTAMP},
+       </if>
+       <if test="clockIn != null">
+         #{clockIn,jdbcType=INTEGER},
+       </if>
+       <if test="clockInTime != null">
+         #{clockInTime,jdbcType=TIMESTAMP},
+       </if>
+       <if test="photoUrl != null">
+         #{photoUrl,jdbcType=VARCHAR},
+       </if>
+       <if test="pid != null">
+         #{pid,jdbcType=VARCHAR},
+       </if>
+       <if test="pname != null">
+         #{pname,jdbcType=VARCHAR},
+       </if>
+       <if test="ufid != null">
+         #{ufid,jdbcType=VARCHAR},
+       </if>
+       <if test="duration != null">
+         #{duration,jdbcType=DOUBLE},
+       </if>
+       <if test="validDate != null">
+         #{validDate,jdbcType=VARCHAR},
+       </if>
+       <if test="newUser != null">
+         #{newUser,jdbcType=INTEGER},
+       </if>
+       <if test="signSum != null">
+         #{signSum,jdbcType=INTEGER},
+       </if>
+       <if test="mianStatus != null">
+         #{mianStatus,jdbcType=INTEGER},
+       </if>
+       <if test="supplement != null">
+         #{supplement,jdbcType=VARCHAR},
+       </if>
+       <if test="auditInfo != null">
+         #{auditInfo,jdbcType=VARCHAR},
+       </if>
+     </trim>
     <selectKey keyProperty="id" order="AFTER" resultType="int">
         SELECT LAST_INSERT_ID()
     </selectKey>
   </insert>
 
   <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
-select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
-date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
-a.latitude ,a.longitude ,a.clock_in clockIn
-from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
-	where 1=1
+  select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
+  date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
+  a.latitude ,a.longitude ,a.clock_in clockIn
+  from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
+      where 1=1
 	<if test="type==0">
 	and a.aid= #{aid}
 	</if>
 	<if test="type==1">
-	and c.superior_id = #{aid}
+	and c.reviewer = #{aid}
 	</if>
 	<if test="clockTime !=null">
 	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
@@ -472,7 +503,7 @@ from public_release a left join `user` b on a.uid =b.id left join admin c on a.a
 	<if test="clockIn !=null">
 	and a.clock_in = #{clockIn}
 	</if>
-	ORDER BY (case when a.status=1 then 1 else 2 end),a.status ,a.create_time
+	ORDER BY (case when a.status=1 then 1 else 2 end),a.status ,a.create_time desc
   	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -486,7 +517,7 @@ from public_release a left join `user` b on a.uid =b.id left join admin c on a.a
 	and a.aid= #{aid}
 	</if>
 	<if test="type==1">
-	and c.superior_id = #{aid}
+    and c.reviewer = #{aid}
 	</if>
 	<if test="clockTime !=null">
 	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
@@ -506,10 +537,10 @@ from public_release a left join `user` b on a.uid =b.id left join admin c on a.a
   </select>
 
   <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
-  		select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
-date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
-a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,a.longitude ,a.aid ,c.superior_id suprId,a.uid
-	from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
+  	select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
+    date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
+    a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,a.longitude ,a.aid ,c.superior_id suprId,a.uid,
+  	a.clock_in clockIn from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
 	where 1=1
 	<if test="id !=null">
 	and a.id= #{id}
@@ -563,15 +594,27 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
   </select>
 
   <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
-	select b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,
-		date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,
-		date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,
-	date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds
-	from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
-	where 1=1
-	<if test="aid != null">
-	and a.aid= #{aid}
-	</if>
+    select a.id,b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,
+    date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,
+    date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,d.name sname,
+    date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds
+    from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
+    left join admin d on b.aid=d.id where 1=1
+    <if test="aid != null">
+      and a.aid= #{aid}
+    </if>
+    <if test="sid != null">
+      and d.id= #{sid}
+    </if>
+    <if test="depId != null">
+      and d.department_id = #{depId}
+    </if>
+    <if test="type==1 and deps !=null">
+       and d.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
+    </if>
 	<if test="uid != null">
 	and a.uid = #{uid}
 	</if>
@@ -584,6 +627,7 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
 	<if test="clockIn !=null">
 	and a.clock_in= #{clockIn}
 	</if>
+    order by a.status,a.create_time desc
 	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -592,22 +636,35 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
   <select id="countPublicDtails" resultType="java.lang.Integer">
   select count(*)
 	from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
+    left join admin d on b.aid=d.id
 	where 1=1
-	<if test="aid != null">
-	and a.aid= #{aid}
-	</if>
-	<if test="uid != null">
-	and a.uid = #{uid}
-	</if>
-	<if test="releaseStart != null and releaseEnd != null">
-	and (a.release_start  between #{releaseStart} and #{releaseEnd} or a.release_end  between #{releaseStart} and #{releaseEnd})
-	</if>
-	<if test="status != null">
-	and a.status = #{status}
-	</if>
-	<if test="clockIn !=null">
-	and a.clock_in= #{clockIn}
-	</if>
+    <if test="aid != null">
+      and a.aid= #{aid}
+    </if>
+    <if test="sid != null">
+      and d.id= #{sid}
+    </if>
+    <if test="depId != null">
+      and d.department_id = #{depId}
+    </if>
+    <if test="type==1 and deps !=null">
+      and d.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
+    </if>
+    <if test="uid != null">
+      and a.uid = #{uid}
+    </if>
+    <if test="releaseStart != null and releaseEnd != null">
+      and (a.release_start  between #{releaseStart} and #{releaseEnd} or a.release_end  between #{releaseStart} and #{releaseEnd})
+    </if>
+    <if test="status != null">
+      and a.status = #{status}
+    </if>
+    <if test="clockIn !=null">
+      and a.clock_in= #{clockIn}
+    </if>
   </select>
 
   <select id="checkTime" resultType="java.lang.Integer">
@@ -616,10 +673,5 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
   or  (release_start &lt; #{start} and release_end &gt; #{start})
   or  (release_start &lt; #{end} and release_end &gt; #{end}))
   </select>
-    <select id="getTimeUserFollow" resultType="com.goafanti.common.model.PublicReleaseCount">
-      select e.id province,d.id depId,a.uid,a.new_user newUser from public_release a left join admin c on a.aid=c.id
-          left join department d on c.department_id =d.id left join district_glossory e on d.province =e.id
-      where a.main_status =1 and a.create_time between #{date} and #{now} group by aid,uid,new_user
-    </select>
 
 </mapper>

Разница между файлами не показана из-за своего большого размера
+ 1344 - 949
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml


+ 15 - 13
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1875,9 +1875,9 @@ date_format(e.create_time ,'%Y-%m-%d')creteTime
 	ifnull(x.wcs,0) completeCount, ifnull(x.gss,0) publicityCount,
 	</if>
 	x.amountCount,x.costAmount,x.profit
-	from (select dep.province, ad.department_id,bp.cid ,sum(kcs.cq) kcs,sum(pds.cq)pds,
+	from (select dep.province, ad.department_id,bp.cid ,sum(kcs.kcs) kcs,sum(kcs.pds)pds,
 	<if test="status==1">
-	sum(wcs.cq)wcs, sum(lxs.cq)lxs,sum(ccs.cq)ccs,sum(wtg.cq)wtg,
+	sum(wcs.wcs)wcs, sum(wcs.lxs)lxs,sum(wcs.ccs)ccs,sum(wcs.wtg)wtg,
 	</if>
 	<if test="status==2 or status==3">
 	sum(tj.sls) sls,sum(tj.wjs)wjs,sum(tj.sqs)sqs, sum(tj.bhs)bhs,
@@ -1889,19 +1889,19 @@ date_format(e.create_time ,'%Y-%m-%d')creteTime
 	sum(tj.sqs) sqs,sum(tj.bhs) bhs,sum(tj.xzs) xzs,
 	</if>
 	<if test="status==0">
-	sum(wcs.cq)wcs, sum(gss.cq)gss,
+	sum(wcs.wcs)wcs, sum(wcs.gss)gss,
 	</if>
 	sum(a.commodity_price)amountCount,sum(ttm.cost_amount)costAmount, (sum(a.commodity_price)-sum(ttm.cost_amount))profit
-	from t_order_task a left join t_order_new b on a.order_no =b.order_no left join t_task_mid ttm on a.id=ttm.tid 
+	from t_order_task a left join t_order_new b on a.order_no =b.order_no and b.delete_sign in(0,2) left join t_task_mid ttm on a.id=ttm.tid
 	left join department dep on b.order_dep =dep.id  inner join admin ad on a.task_receiver =ad.id
 	left join business_project bp on a.commodity_id =bp.id 
-	left join (select id,commodity_quantity cq from t_order_task where project_status BETWEEN  1 and 3)kcs on a.id=kcs.id
-	left join (select id,commodity_quantity cq from t_order_task where task_status in (1,2,3))pds on a.id=pds.id
+	left join (select id,if(project_status BETWEEN  1 and 3,commodity_quantity,0) kcs,
+     if(task_status in (1,2,3),commodity_quantity,0) pds from t_order_task)kcs on a.id=kcs.id
+
 	<if test="status==1">
-	left join (select id,commodity_quantity cq from t_order_task where project_status &gt; 3)wcs on a.id=wcs.id
-	left join (select id,commodity_quantity cq from t_order_task where  set_up_status =1)lxs on a.id=lxs.id
-	left join (select id,commodity_quantity cq from t_order_task where spot_check_status in (1,2))ccs on a.id=ccs.id
-	left join (select id,commodity_quantity cq from t_order_task where spot_check_status =1)wtg on a.id=wtg.id
+	left join (select id,if(project_status > 3,commodity_quantity,0) wcs, if( set_up_status=1,commodity_quantity,0) lxs,
+      if(spot_check_status in (1,2),commodity_quantity,0) ccs, if( spot_check_status =1,commodity_quantity,0) wtg
+      from t_order_task )wcs on a.id=wcs.id
 	</if>
 	<if test="status==2 or status==3">
 	left join (select tid ,accept_count sls,end_count wjs,authorize_count sqs,reject_count bhs from t_task_mid 
@@ -1915,8 +1915,10 @@ date_format(e.create_time ,'%Y-%m-%d')creteTime
 	where apply_count &gt; 0)tj on a.id=tj.tid
 	</if>
 	<if test="status==0">
-	left join (select id,commodity_quantity cq from t_order_task where project_status &gt; 3)wcs on a.id=wcs.id
-	left join (select id,commodity_quantity cq from t_order_task where  if_publicity=1)gss on a.id=gss.id
+	left join (select id,if(project_status > 3,commodity_quantity,0) wcs,
+      if( if_publicity=1,commodity_quantity,0) gss
+      from t_order_task )wcs on a.id=wcs.id
+
 	</if>
 	where a.split_status in(0,2)
 	<if test="startDate != null and endDate != null">
@@ -1947,7 +1949,7 @@ inner join department de on x.department_id=de.id left join business_category bc
   <select id="selectProvincialStatisticsCount" resultType="java.lang.Integer">
   select count(*)
 	from (select dep.province, ad.department_id,bp.cid 
-	from t_order_task a left join t_order_new b on a.order_no =b.order_no left join t_task_mid ttm on a.id=ttm.tid 
+	from t_order_task a left join t_order_new b on a.order_no =b.order_no  and b.delete_sign in(0,2) left join t_task_mid ttm on a.id=ttm.tid
 	left join department dep on b.order_dep =dep.id  inner join admin ad on a.task_receiver =ad.id
 	left join business_project bp on a.commodity_id =bp.id 
 	where   a.split_status in(0,2) 

+ 1 - 1
src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml

@@ -415,7 +415,7 @@
   <select id="selectFollowCountByUAid" parameterType="java.lang.String" resultType="java.lang.Integer">
   	select count(0) from user_follow where uid = #{uid,jdbcType=VARCHAR}
   	<if test="aid !=null">
-=   and aid = #{aid,jdbcType=VARCHAR}
+   and aid = #{aid,jdbcType=VARCHAR}
     </if>
   </select>
   

+ 4 - 2
src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

@@ -271,8 +271,10 @@
       select b.nickname,b.share_type shareType ,b.channel,b.id,date_format(b.transfer_time,'%Y-%m-%d %H:%i:%s')startTimes,
       a.contact_type contactType,a.follow_name followName ,a.follow_dep followDep,a.`result` ,a.follow_count followCount,
       date_format(a.create_time ,'%Y-%m-%d %H:%i:%s')followTimes,a.guidance_name guidanceName, a.guidance ,
-      date_format(a.guidance_time,'%Y-%m-%d %H:%i:%s') guidanceTimes
-      from user_follow a left join `user`b on a.uid =b.id
+      date_format(a.guidance_time,'%Y-%m-%d %H:%i:%s') guidanceTimes,c.contacts ,c.contact_mobile contactMobile,
+      c.location_province province ,c.location_city city ,c.location_area area,
+      c.intended_project intendedProject ,c.business_scope businessScope
+      from user_follow a left join `user`b on a.uid =b.id left join organization_identity c on a.uid=c.uid
       where 1=1
       <if test="shiroType == 0">
       and a.aid= #{aid}

+ 9 - 6
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -661,15 +661,14 @@
 
 	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
 		select a.id as followId, a.aid,date_format( a.create_time,'%Y-%m-%d %H:%i:%S') as followTime, a.contact_type as contactType,
-		a.result,a.guidance, b.nickname,b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,
+		a.result,a.guidance, b.nickname,b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,pr.supplement ,pr.id prid,
 		d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime,a.guidance_name guidanceName
+
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->
 			,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
 		</if>
-		from user_follow a
-		left join user b on a.uid = b.id
-		left join organization_contact_book c on a.ocb_id = c.id
-		left join admin d on a.aid = d.id
+		from user_follow a left join user b on a.uid = b.id left join organization_contact_book c on a.ocb_id = c.id
+		left join admin d on a.aid = d.id left join public_release pr on a.id =pr.ufid
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->
 			inner join user_follow_business e on a.id = e.follow_id
 		</if>
@@ -733,7 +732,11 @@
 		from organization_contact_book a left join admin ad on a.aid=ad.id
 		 left join organization_identity b on a.uid=b.uid left join district_glossory d1 on b.location_province=d1.id
 		 left join district_glossory d2 on b.location_city=d2.id left join district_glossory d3 on b.location_area=d3.id
-		where a.uid = #{uid,jdbcType=VARCHAR} and a.aid= #{aid,jdbcType=VARCHAR} order by a.create_time desc
+		where a.uid = #{uid,jdbcType=VARCHAR}
+		  <if test="aid !=null">
+		and a.aid= #{aid,jdbcType=VARCHAR}
+		</if>
+		order by a.create_time desc
 	</select>
 
 	<select id="findAllContacts" parameterType="java.lang.String" resultType="com.goafanti.common.model.OrganizationContactBook">

+ 316 - 310
src/main/java/com/goafanti/common/model/Admin.java

@@ -1,325 +1,331 @@
 package com.goafanti.common.model;
 
-import java.util.Date;
-
+import com.goafanti.common.constant.AFTConstants;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.goafanti.common.constant.AFTConstants;
+import java.io.Serializable;
+import java.util.Date;
 
+/**
+ * admin
+ * @author 
+ */
 public class Admin extends BaseModel implements AftUser {
-	private static final long	serialVersionUID	= 1L;
-
-	private String				id;
-
-	/**
-	 * 手机�?(登录帐号)
-	 */
-	private String				mobile;
-
-	/**
-	 * 用户�?
-	 */
-	private String				name;
-
-	/**
-	 * 密码
-	 */
-	private String				password;
-
-	/**
-	 * 邮箱
-	 */
-	private String				email;
-
-	/**
-	 * 创建时间
-	 */
-	private Date				createTime;
-
-	/**
-	 * 员工工号
-	 */
-	private Integer				number;
-
-	/**
-	 * �?在省�?
-	 */
-	private Integer				province;
-	/**
-	 * 岗位
-	 */
-	private String				position;
-
-	/**
-	 * 上级管理用户ID
-	 */
-	private String				superiorId;
-	
-	/**
-	 * 上级管理用户名称
-	 */
-	private String	superior;
-
-	/**
-	 * �?在市
-	 */
-	private Integer				city;
-	
-	/**
-	 * 部门管理
-	 */
-	private String 				departmentId;
-	/**
-	 * 用户状�??
-	 */
-	private String 				status;
-	/**
-	 * 用户编号
-	 */
-	private String 				userNo;
-	/**
-	 * 职务
-	 */
-	private String 				duty;
-	
-	/**
-	 * 地区
-	 */
-	private String 				district;
-	
-	/**
-	 * 用户头像
-	 */
-	private String 				headPortraitUrl;	
-	
-	private String	openId;
-
-	/**
-	 * �?在市
-	 */
-	private Integer				type;
-
-	public void setType(Integer type) {
-		this.type = type;
-	}
-
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column admin.contact_mobile
-	 * @mbg.generated  Wed Jun 13 10:27:07 CST 2018
-	 */
-	private String contactMobile;
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column admin.id
-	 * @return  the value of admin.id
-	 * @mbg.generated  Wed Jun 13 10:27:07 CST 2018
-	 */
-	private Date lastLoginTime;
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column admin.contact_mobile
-	 * @return  the value of admin.contact_mobile
-	 * @mbg.generated  Wed Jun 13 10:27:07 CST 2018
-	 */
-	public String getContactMobile() {
-		return contactMobile;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column admin.contact_mobile
-	 * @param contactMobile  the value for admin.contact_mobile
-	 * @mbg.generated  Wed Jun 13 10:27:07 CST 2018
-	 */
-	public void setContactMobile(String contactMobile) {
-		this.contactMobile = contactMobile;
-	}
-
-	
-	
-	public String getSuperior() {
-		return superior;
-	}
-
-	public void setSuperior(String superior) {
-		this.superior = superior;
-	}
-
-	public String getHeadPortraitUrl() {
-		return headPortraitUrl;
-	}
-
-	public void setHeadPortraitUrl(String headPortraitUrl) {
-		this.headPortraitUrl = headPortraitUrl;
-	}
-
-	public String getDistrict() {
-		return district;
-	}
-
-	public void setDistrict(String district) {
-		this.district = district;
-	}
-
-	public String getStatus() {
-		return status;
-	}
-
-	public void setStatus(String status) {
-		this.status = status;
-	}
-
-	public String getUserNo() {
-		return userNo;
-	}
-
-	public void setUserNo(String userNo) {
-		this.userNo = userNo;
-	}
-
-	public String getDuty() {
-		return duty;
-	}
-
-	public void setDuty(String duty) {
-		this.duty = duty;
-	}
-
-	public String getSuperiorId() {
-		return superiorId;
-	}
-
-	public void setSuperiorId(String superiorId) {
-		this.superiorId = superiorId;
-	}
-
-
-	public String getPosition() {
-		return position;
-	}
-
-	public void setPosition(String position) {
-		this.position = position;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public String getMobile() {
-		return mobile;
-	}
-
-	public void setMobile(String mobile) {
-		this.mobile = mobile;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	@JsonIgnore
-	public String getPassword() {
-		return password;
-	}
-
-	public void setPassword(String password) {
-		this.password = password;
-	}
-
-	public String getEmail() {
-		return email;
-	}
-
-	public void setEmail(String email) {
-		this.email = email;
-	}
-
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	public Integer getNumber() {
-		return number;
-	}
-
-	public void setNumber(Integer number) {
-		this.number = number;
-	}
-
-
-	public Integer getProvince() {
-		return province;
-	}
+    private static final long	serialVersionUID	= 1L;
+
+    private String id;
+
+    /**
+     * 手机号(登录帐号)
+     */
+    private String mobile;
+
+    /**
+     * 用户名
+     */
+    private String name;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    private Integer number;
+
+    /**
+     * 所在省份
+     */
+    private String province;
+
+    /**
+     * 职位
+     */
+    private String position;
+
+    /**
+     * 上级管理用户ID
+     */
+    private String superiorId;
+
+    /**
+     * 所在市
+     */
+    private String city;
+
+    /**
+     * 部门ID
+     */
+    private String departmentId;
+
+    /**
+     * 用户状态
+     */
+    private String status;
+
+    /**
+     * 用户编号
+     */
+    private String userNo;
+
+    /**
+     * 职务
+     */
+    private String duty;
+
+    /**
+     * 地区
+     */
+    private String district;
+
+    /**
+     * 用户头像地址
+     */
+    private String headPortraitUrl;
+
+    /**
+     * 联系电话
+     */
+    private String contactMobile;
+
+    /**
+     * 最后登录时间
+     */
+    private Date lastLoginTime;
+
+    /**
+     * 微信公共编号
+     */
+    private String openId;
+
+    /**
+     * 0普通 1营销 2财务 3咨询
+     */
+    private Integer type;
+
+    /**
+     * 公出审核人
+     */
+    private String reviewer;
+
+    /**
+     * 上级管理用户名称
+     */
+    private String	superior;
+    private String reviewerName;
+
+    public String getReviewerName() {
+        return reviewerName;
+    }
+
+    public void setReviewerName(String reviewerName) {
+        this.reviewerName = reviewerName;
+    }
+
+    public String getSuperior() {
+        return superior;
+    }
+
+    public void setSuperior(String superior) {
+        this.superior = superior;
+    }
+
+    // 创建时间
+    public String getCreateTimeFormattedDate() {
+        if (this.createTime == null) {
+            return null;
+        } else {
+            return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+        }
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    @Override
+    public String getAid() {
+        return id;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    public String getSuperiorId() {
+        return superiorId;
+    }
+
+    public void setSuperiorId(String superiorId) {
+        this.superiorId = superiorId;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getDepartmentId() {
+        return departmentId;
+    }
+
+    public void setDepartmentId(String departmentId) {
+        this.departmentId = departmentId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getUserNo() {
+        return userNo;
+    }
+
+    public void setUserNo(String userNo) {
+        this.userNo = userNo;
+    }
+
+    public String getDuty() {
+        return duty;
+    }
+
+    public void setDuty(String duty) {
+        this.duty = duty;
+    }
+
+    public String getDistrict() {
+        return district;
+    }
+
+    public void setDistrict(String district) {
+        this.district = district;
+    }
+
+    public String getHeadPortraitUrl() {
+        return headPortraitUrl;
+    }
+
+    public void setHeadPortraitUrl(String headPortraitUrl) {
+        this.headPortraitUrl = headPortraitUrl;
+    }
+
+    public String getContactMobile() {
+        return contactMobile;
+    }
+
+    public void setContactMobile(String contactMobile) {
+        this.contactMobile = contactMobile;
+    }
 
-	public void setProvince(Integer province) {
-		this.province = province;
-	}
+    public Date getLastLoginTime() {
+        return lastLoginTime;
+    }
 
-	public Integer getCity() {
-		return city;
-	}
+    public void setLastLoginTime(Date lastLoginTime) {
+        this.lastLoginTime = lastLoginTime;
+    }
 
-	public void setCity(Integer city) {
-		this.city = city;
-	}
+    public String getOpenId() {
+        return openId;
+    }
 
-	public String getDepartmentId() {
-		return departmentId;
-	}
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
 
-	public void setDepartmentId(String departmentId) {
-		this.departmentId = departmentId;
-	}
+    public Integer getType() {
+        return type;
+    }
 
-	// 创建时间
-	public String getCreateTimeFormattedDate() {
-		if (this.createTime == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
+    public void setType(Integer type) {
+        this.type = type;
+    }
 
-	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
-
-	}
+    public String getReviewer() {
+        return reviewer;
+    }
 
-	@JsonIgnore
-	@Override
-	public String getAid() {
-		return null;
-	}
-
-	@Override
-	public Integer getType() {
-		return this.type;
-	}
-
-	public Date getLastLoginTime() {
-		return lastLoginTime;
-	}
-
-	public void setLastLoginTime(Date lastLoginTime) {
-		this.lastLoginTime = lastLoginTime;
-	}
-
-	public String getOpenId() {
-		return openId;
-	}
-
-	public void setOpenId(String openId) {
-		this.openId = openId;
-	}
+    public void setReviewer(String reviewer) {
+        this.reviewer = reviewer;
+    }
 }

+ 405 - 184
src/main/java/com/goafanti/common/model/PublicRelease.java

@@ -5,7 +5,7 @@ import java.util.Date;
 
 /**
  * public_release
- * @author 
+ * @author
  */
 public class PublicRelease implements Serializable {
     private Integer id;
@@ -118,191 +118,412 @@ public class PublicRelease implements Serializable {
     /**
      * 0辅助根据 1主要跟进
      */
-    private Integer mainStatus;
+    private Integer mianStatus;
 
-    private static final long serialVersionUID = 1L;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getUid() {
-        return uid;
-    }
-
-    public void setUid(String uid) {
-        this.uid = uid;
-    }
-
-    public String getAid() {
-        return aid;
-    }
-
-    public void setAid(String aid) {
-        this.aid = aid;
-    }
-
-    public Date getReleaseStart() {
-        return releaseStart;
-    }
-
-    public void setReleaseStart(Date releaseStart) {
-        this.releaseStart = releaseStart;
-    }
-
-    public Date getReleaseEnd() {
-        return releaseEnd;
-    }
-
-    public void setReleaseEnd(Date releaseEnd) {
-        this.releaseEnd = releaseEnd;
-    }
-
-    public String getRemarks() {
-        return remarks;
-    }
-
-    public void setRemarks(String remarks) {
-        this.remarks = remarks;
-    }
-
-    public String getAnnexUrl() {
-        return annexUrl;
-    }
-
-    public void setAnnexUrl(String annexUrl) {
-        this.annexUrl = annexUrl;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getLongitude() {
-        return longitude;
-    }
-
-    public void setLongitude(String longitude) {
-        this.longitude = longitude;
-    }
-
-    public String getLatitude() {
-        return latitude;
-    }
-
-    public void setLatitude(String latitude) {
-        this.latitude = latitude;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Integer getClockIn() {
-        return clockIn;
-    }
-
-    public void setClockIn(Integer clockIn) {
-        this.clockIn = clockIn;
-    }
-
-    public Date getClockInTime() {
-        return clockInTime;
-    }
-
-    public void setClockInTime(Date clockInTime) {
-        this.clockInTime = clockInTime;
-    }
-
-    public String getPhotoUrl() {
-        return photoUrl;
-    }
-
-    public void setPhotoUrl(String photoUrl) {
-        this.photoUrl = photoUrl;
-    }
-
-    public String getPid() {
-        return pid;
-    }
-
-    public void setPid(String pid) {
-        this.pid = pid;
-    }
-
-    public String getPname() {
-        return pname;
-    }
-
-    public void setPname(String pname) {
-        this.pname = pname;
-    }
-
-    public String getUfid() {
-        return ufid;
-    }
-
-    public void setUfid(String ufid) {
-        this.ufid = ufid;
-    }
-
-    public Double getDuration() {
-        return duration;
-    }
-
-    public void setDuration(Double duration) {
-        this.duration = duration;
-    }
-
-    public String getValidDate() {
-        return validDate;
-    }
-
-    public void setValidDate(String validDate) {
-        this.validDate = validDate;
-    }
-
-    public Integer getNewUser() {
-        return newUser;
-    }
-
-    public void setNewUser(Integer newUser) {
-        this.newUser = newUser;
-    }
-
-    public Integer getSignSum() {
-        return signSum;
-    }
+    /**
+     * 公出补充
+     */
+    private String supplement;
 
-    public void setSignSum(Integer signSum) {
-        this.signSum = signSum;
-    }
+    /**
+     * 审核信息
+     */
+    private String auditInfo;
 
-    public Integer getMainStatus() {
-        return mainStatus;
-    }
+    private static final long serialVersionUID = 1L;
 
-    public void setMainStatus(Integer mainStatus) {
-        this.mainStatus = mainStatus;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.id
+	 * @return  the value of public_release.id
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.id
+	 * @param id  the value for public_release.id
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.uid
+	 * @return  the value of public_release.uid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getUid() {
+		return uid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.uid
+	 * @param uid  the value for public_release.uid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setUid(String uid) {
+		this.uid = uid == null ? null : uid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.aid
+	 * @return  the value of public_release.aid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getAid() {
+		return aid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.aid
+	 * @param aid  the value for public_release.aid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setAid(String aid) {
+		this.aid = aid == null ? null : aid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.release_start
+	 * @return  the value of public_release.release_start
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Date getReleaseStart() {
+		return releaseStart;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.release_start
+	 * @param releaseStart  the value for public_release.release_start
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setReleaseStart(Date releaseStart) {
+		this.releaseStart = releaseStart;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.release_end
+	 * @return  the value of public_release.release_end
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Date getReleaseEnd() {
+		return releaseEnd;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.release_end
+	 * @param releaseEnd  the value for public_release.release_end
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setReleaseEnd(Date releaseEnd) {
+		this.releaseEnd = releaseEnd;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.remarks
+	 * @return  the value of public_release.remarks
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getRemarks() {
+		return remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.remarks
+	 * @param remarks  the value for public_release.remarks
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setRemarks(String remarks) {
+		this.remarks = remarks == null ? null : remarks.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.user_name
+	 * @return  the value of public_release.user_name
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getUserName() {
+		return userName;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.user_name
+	 * @param userName  the value for public_release.user_name
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setUserName(String userName) {
+		this.userName = userName == null ? null : userName.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.longitude
+	 * @return  the value of public_release.longitude
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getLongitude() {
+		return longitude;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.longitude
+	 * @param longitude  the value for public_release.longitude
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setLongitude(String longitude) {
+		this.longitude = longitude == null ? null : longitude.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.latitude
+	 * @return  the value of public_release.latitude
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getLatitude() {
+		return latitude;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.latitude
+	 * @param latitude  the value for public_release.latitude
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setLatitude(String latitude) {
+		this.latitude = latitude == null ? null : latitude.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.status
+	 * @return  the value of public_release.status
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Integer getStatus() {
+		return status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.status
+	 * @param status  the value for public_release.status
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.create_time
+	 * @return  the value of public_release.create_time
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.create_time
+	 * @param createTime  the value for public_release.create_time
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.clock_in
+	 * @return  the value of public_release.clock_in
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Integer getClockIn() {
+		return clockIn;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.clock_in
+	 * @param clockIn  the value for public_release.clock_in
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setClockIn(Integer clockIn) {
+		this.clockIn = clockIn;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.clock_in_time
+	 * @return  the value of public_release.clock_in_time
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Date getClockInTime() {
+		return clockInTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.clock_in_time
+	 * @param clockInTime  the value for public_release.clock_in_time
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setClockInTime(Date clockInTime) {
+		this.clockInTime = clockInTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.pid
+	 * @return  the value of public_release.pid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getPid() {
+		return pid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.pid
+	 * @param pid  the value for public_release.pid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setPid(String pid) {
+		this.pid = pid == null ? null : pid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.pname
+	 * @return  the value of public_release.pname
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getPname() {
+		return pname;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.pname
+	 * @param pname  the value for public_release.pname
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setPname(String pname) {
+		this.pname = pname == null ? null : pname.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.ufid
+	 * @return  the value of public_release.ufid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getUfid() {
+		return ufid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.ufid
+	 * @param ufid  the value for public_release.ufid
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setUfid(String ufid) {
+		this.ufid = ufid == null ? null : ufid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.duration
+	 * @return  the value of public_release.duration
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public Double getDuration() {
+		return duration;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.duration
+	 * @param duration  the value for public_release.duration
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setDuration(Double duration) {
+		this.duration = duration;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.valid_date
+	 * @return  the value of public_release.valid_date
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getValidDate() {
+		return validDate;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.valid_date
+	 * @param validDate  the value for public_release.valid_date
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setValidDate(String validDate) {
+		this.validDate = validDate == null ? null : validDate.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.annex_url
+	 * @return  the value of public_release.annex_url
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getAnnexUrl() {
+		return annexUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.annex_url
+	 * @param annexUrl  the value for public_release.annex_url
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setAnnexUrl(String annexUrl) {
+		this.annexUrl = annexUrl == null ? null : annexUrl.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.photo_url
+	 * @return  the value of public_release.photo_url
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public String getPhotoUrl() {
+		return photoUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.photo_url
+	 * @param photoUrl  the value for public_release.photo_url
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	public void setPhotoUrl(String photoUrl) {
+		this.photoUrl = photoUrl == null ? null : photoUrl.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
+	 */
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getClass().getSimpleName());
+		sb.append(" [");
+		sb.append("Hash = ").append(hashCode());
+		sb.append(", id=").append(id);
+		sb.append(", uid=").append(uid);
+		sb.append(", aid=").append(aid);
+		sb.append(", releaseStart=").append(releaseStart);
+		sb.append(", releaseEnd=").append(releaseEnd);
+		sb.append(", remarks=").append(remarks);
+		sb.append(", userName=").append(userName);
+		sb.append(", longitude=").append(longitude);
+		sb.append(", latitude=").append(latitude);
+		sb.append(", status=").append(status);
+		sb.append(", createTime=").append(createTime);
+		sb.append(", clockIn=").append(clockIn);
+		sb.append(", clockInTime=").append(clockInTime);
+		sb.append(", pid=").append(pid);
+		sb.append(", pname=").append(pname);
+		sb.append(", ufid=").append(ufid);
+		sb.append(", duration=").append(duration);
+		sb.append(", validDate=").append(validDate);
+		sb.append(", annexUrl=").append(annexUrl);
+		sb.append(", photoUrl=").append(photoUrl);
+		sb.append(", serialVersionUID=").append(serialVersionUID);
+		sb.append("]");
+		return sb.toString();
+	}
 }

+ 67 - 78
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -68,7 +68,7 @@ public class OrderDunTask {
 	private String devName=null;
 	@Autowired
 	private AsyncUtils	asyncUtils;
-	Logger							logger	= LoggerFactory.getLogger(OrderDunTask.class);
+	Logger	logger	= LoggerFactory.getLogger(OrderDunTask.class);
 	
 	/**
 	 * 	每天凌晨3点轮
@@ -81,7 +81,7 @@ public class OrderDunTask {
 	public void startTask() throws InterruptedException {
 		updateNewOrderDun();
 		Thread.sleep(2000);
-		updateorderDun();
+//		updateorderDun();
 		Thread.sleep(2000);
 		updatePaymentNode();
 	}
@@ -94,49 +94,43 @@ public class OrderDunTask {
   		try {
   			LoggerUtils.debug(logger, "======================新催款任务轮询启动===================");
   		List<OutNewOrderDunBo> list= newOrderDunService.selectAllOrderDun();
-  		Calendar calendar=Calendar.getInstance();   
-  		Calendar calendar2=Calendar.getInstance();
+  		Calendar now=Calendar.getInstance();
+  		Calendar now2=Calendar.getInstance();
   		Date date =new Date();
   		for (OutNewOrderDunBo o : list) {
-  			calendar.setTime(date);
-  			calendar2.setTime(o.getCreateTime());
-  			if (o!=null&&o.getApproval()!=null&&o.getApproval()!=0&&o.getDunType()==1&&o.getWaitDay()!=null) {
-  					calendar2.add(Calendar.DATE, o.getWaitDay());
-  					if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
-  						updateOrderDun(o);
-  						Thread.sleep(2000);
-  					}
-			}
-  			if(o.getProjectType()==OrderDunProjectType.HY.getCode()&&o.getDunType()==2) {
-  				calendar2.add(Calendar.DATE, o.getEffectiveCount()*180);
-  				CalendarTimeCleared(calendar2);
-  				if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
+  			now.setTime(date);
+  			now2.setTime(o.getCreateTime());
+  			//特批首期款 计算出触发时间
+  			if (o!=null&&o.getApproval()!=null&&
+					(o.getApproval()==1||o.getApproval()==2)&&
+						o.getDunType()==1&&o.getWaitDay()!=null) {
+  					now2.add(Calendar.DATE, o.getWaitDay());
+  					//会员-期限 计算触发时间
+  			}else if(o.getProjectType()==OrderDunProjectType.HY.getCode()&&o.getDunType()==2) {
+  				now2.add(Calendar.DATE, o.getEffectiveCount()*180);
+  				CalendarTimeCleared(now2);
+  				if (now.getTimeInMillis() > now2.getTimeInMillis()) {//当前时间大于计算后时间则触发
   	  	  			updateOrderDun(o);
   	  	  			Thread.sleep(2000);
   				}
-  			}
-  			if(o.getProjectType()==OrderDunProjectType.CS.getCode()&&o.getDunType()==2) {
+  			//财税-期限 计算时间
+  			} else if(o.getProjectType()==OrderDunProjectType.CS.getCode()&&o.getDunType()==2) {
   			//获取年
-  				int year = calendar2.get(Calendar.YEAR);  
+  				int year = now2.get(Calendar.YEAR);
   		        //获取月份,0表示1月份
-  		        int month = calendar2.get(Calendar.MONTH) + 1;
+  		        int month = now2.get(Calendar.MONTH) + 1;
   		        if(month<10)year=year+1;
   		        if(month>9)year=year+2;
-  		        calendar2.set(year, 5, 1);
-  		        CalendarTimeCleared(calendar2);
-  				if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
-  	  	  			updateOrderDun(o);
-  	  	  			Thread.sleep(2000);
-  				}
-  			}
-  	  		if (o.getDunType()==0) {
-  	  		calendar2.setTime(o.getCustomizeTime());
-  	  		CalendarTimeCleared(calendar);
-  	  			if (calendar.equals(calendar2)) {
-  	  				updateOrderDun(o);
-	  	  			Thread.sleep(2000);
-				}
-				
+  		        now2.set(year, 5, 1);
+  		        CalendarTimeCleared(now2);
+			//自定义 超过设置的时间则触发
+  			}else if (o.getDunType()==0) {
+  	  		now2.setTime(o.getCustomizeTime());
+  	  		CalendarTimeCleared(now);
+			}
+			if (now.getTimeInMillis() > now2.getTimeInMillis()) {
+				updateOrderDun(o);
+				Thread.sleep(2000);
 			}
 		}
   		
@@ -155,42 +149,33 @@ public class OrderDunTask {
 	 */
 	private void updatePaymentNode() {
 		LoggerUtils.debug(logger, "======================催款任务结束,付款催款开始===================");
-		Calendar calendar=Calendar.getInstance();   
-  		Calendar calendar2=Calendar.getInstance();
+		Calendar now=Calendar.getInstance();
+  		Calendar now2=Calendar.getInstance();
   		try {
   		List<OutPaymentNode> list2=paymentNodeMapper.selectByStatus(0);
   		for (OutPaymentNode pn : list2) {
-  			calendar2.setTime(pn.getCreateTime());
+  			now2.setTime(pn.getCreateTime());
   			if(pn.getProjectType()==OrderDunProjectType.HY.getCode()&&pn.getDunType()==2) {
-  				calendar2.add(Calendar.DATE, pn.getEffectiveCount()*180);
-  				CalendarTimeCleared(calendar2);
-  				if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
-  					updatePaymentNode(pn);
-						Thread.sleep(2000);
-  				}
-  			}
-  			if(pn.getProjectType()==OrderDunProjectType.CS.getCode()&&pn.getDunType()==2) {
+  				now2.add(Calendar.DATE, pn.getEffectiveCount()*180);
+  				CalendarTimeCleared(now2);
+  			}else if(pn.getProjectType()==OrderDunProjectType.CS.getCode()&&pn.getDunType()==2) {
   				//	获取年
-  				int year = calendar2.get(Calendar.YEAR);  
+  				int year = now2.get(Calendar.YEAR);
   		        //获取月份,0表示1月份
-  		        int month = calendar2.get(Calendar.MONTH) + 1;
+  		        int month = now2.get(Calendar.MONTH) + 1;
   		        if(month<10)year=year+1;
   		        if(month>9)year=year+2;
-  		        calendar2.set(year, 5, 1);
-  		        CalendarTimeCleared(calendar2);
-  				if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
-  					updatePaymentNode(pn);
-  	  	  			Thread.sleep(2000);
-  				}
-  			}
-  	  		if (pn.getDunType()==0) {
-  	  		calendar2.setTime(pn.getPartyTime());
-  	  		CalendarTimeCleared(calendar);
-  	  			if (calendar.equals(calendar2)) {
-  	  				updatePaymentNode(pn);
-	  	  			Thread.sleep(2000);
-				}
+  		        now2.set(year, 5, 1);
+  		        CalendarTimeCleared(now2);
+
+  			}else if (pn.getDunType()==0) {
+  	  		now2.setTime(pn.getPartyTime());
+  	  		CalendarTimeCleared(now);
   	  		}
+			if (now.getTimeInMillis() > now2.getTimeInMillis()) {//当前时间大于计算后时间则触发
+				updatePaymentNode(pn);
+				Thread.sleep(1000);
+			}
   		}
   		} catch (InterruptedException e) {
   			LoggerUtils.error(getClass(), "===========================付款催款失败==========================", e);
@@ -214,6 +199,8 @@ public class OrderDunTask {
 			for (TArrearsDun td : list) {
 				TOrderMid tm=tOrderMidMapper.selectByOrderNo(td.getOrderNo());
 				//如果欠款大于0则需要触发邮件
+				System.out.println(tm.toString());
+				System.out.println(tm.getOrderArrears());
 				if (tm.getOrderArrears().compareTo(new BigDecimal(0))>0) {
 					td.setDunStatus(1);
 					td.setStartTime(date);
@@ -320,11 +307,11 @@ public class OrderDunTask {
 	
 
 
-	private void CalendarTimeCleared(Calendar calendar) {
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-	    calendar.set(Calendar.MINUTE, 0);
-	    calendar.set(Calendar.SECOND, 0);
-	    calendar.set(Calendar.MILLISECOND, 0);
+	private void CalendarTimeCleared(Calendar now) {
+		now.set(Calendar.HOUR_OF_DAY, 0);
+	    now.set(Calendar.MINUTE, 0);
+	    now.set(Calendar.SECOND, 0);
+	    now.set(Calendar.MILLISECOND, 0);
 	}
 
 
@@ -333,9 +320,10 @@ public class OrderDunTask {
 		o.setId(t.getId());
 		o.setStatus(1);
 		o.setStartTime(new Date());
-		newOrderDunService.updateDun(o);
+		if (t.getMoney()==null)t.setMoney(new BigDecimal(0));
 		tOrderMidMapper.addOrderReceivables(t.getOrderNo(),t.getMoney());
 		TOrderMid tm=tOrderMidMapper.selectByOrderNo(t.getOrderNo());
+		newOrderDunService.updateDun(o);
 			TArrearsDun td=new TArrearsDun();
 			td.setOrderArrears(tm.getOrderArrears());
 			td.setOrderReceivables(tm.getOrderReceivables());
@@ -356,15 +344,16 @@ public class OrderDunTask {
 	
 	private void addNotic(String orderNo, TArrearsDun td, Integer code) throws UnsupportedEncodingException, MessagingException {
 		TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(orderNo);
-			String str=NoticeStatus.getValueByCode(code)+": 订单编号 -"+orderNo+", 操作人: "+b.getSalesmanName()+".";
-			LoggerUtils.debug(getClass(), "/n"+str);
-			Notice n =new Notice();
-			n.setId(UUID.randomUUID().toString());
-			n.setAid(b.getSalesmanId());
-			n.setNoticeType(code);
-			n.setContent(str);
-			n.setReaded(0);//未读
-			asyncUtils.addNotice(n);
+		StringBuffer str =new StringBuffer();
+		str=str.append(b.getUserName()).append(", 合同编号-").append(b.getContractNo())
+				.append(", 订单编号-").append(orderNo).append(", 操作人: ").append(b.getSalesmanName()).append("。");
+		Notice n =new Notice();
+		n.setId(UUID.randomUUID().toString());
+		n.setAid(b.getSalesmanId());
+		n.setNoticeType(code);
+		n.setContent(str.toString());
+		n.setReaded(0);//未读
+		asyncUtils.addNotice(n);
 	}
 
 

+ 0 - 15
src/main/java/com/goafanti/common/utils/DateUtils.java

@@ -53,7 +53,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	 *            the first date, not <code>null</code>
 	 * @param date2
 	 *            the second date, not <code>null</code>
-	 * @param field
 	 *            the field from <code>Calendar</code>
 	 * @return diff millis
 	 * @throws IllegalArgumentException
@@ -74,7 +73,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	 *            the first date, not <code>null</code>
 	 * @param date2
 	 *            the second date, not <code>null</code>
-	 * @param field
 	 *            the field from <code>Calendar</code>
 	 * @return diff millis
 	 * @throws IllegalArgumentException
@@ -170,8 +168,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	/**
 	 * 返回指定日期的月的第一天
 	 *
-	 * @param year
-	 * @param month
 	 * @return
 	 */
 	public static Date getFirstDayOfMonth(Date date) {
@@ -205,8 +201,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	/**
 	 * 返回指定日期的月的最后一天
 	 *
-	 * @param year
-	 * @param month
 	 * @return
 	 */
 	public static Date getLastDayOfMonth(Date date) {
@@ -242,8 +236,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	/**
 	 * 返回指定日期的上个月的最后一天
 	 *
-	 * @param year
-	 * @param month
 	 * @return
 	 */
 	public static Date getLastDayOfLastMonth(Date date) {
@@ -258,8 +250,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	/**
 	 * 返回指定日期的季的第一天
 	 *
-	 * @param year
-	 * @param quarter
 	 * @return
 	 */
 	public static Date getFirstDayOfQuarter(Date date) {
@@ -295,8 +285,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	/**
 	 * 返回指定日期的季的最后一天
 	 *
-	 * @param year
-	 * @param quarter
 	 * @return
 	 */
 	public static Date getLastDayOfQuarter(Date date) {
@@ -332,8 +320,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	/**
 	 * 返回指定日期的上一季的最后一天
 	 *
-	 * @param year
-	 * @param quarter
 	 * @return
 	 */
 	public static Date getLastDayOfLastQuarter(Date date) {
@@ -450,7 +436,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 
 	/**
 	 * 时分秒毫秒归零
-	 * @param c
 	 * @return
 	 */
 	public static Date getEarlyToday() {

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

@@ -50,6 +50,7 @@ import org.apache.poi.util.IOUtils;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
 import org.apache.poi.xssf.usermodel.XSSFDataValidation;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -87,7 +88,7 @@ public class NewExcelUtil<T> {
 	/**
 	 * 工作薄对象
 	 */
-	private Workbook wb;
+	private XSSFWorkbook wb;
 
 	/**
 	 * 工作表对象
@@ -834,7 +835,7 @@ public class NewExcelUtil<T> {
 	 * 创建一个工作簿
 	 */
 	public void createWorkbook() {
-		this.wb = new SXSSFWorkbook(500);
+		this.wb = new XSSFWorkbook();
 	}
 
 	/**

+ 20 - 0
src/main/java/com/goafanti/customer/bo/FollowListBo.java

@@ -45,8 +45,28 @@ public class FollowListBo {
 	/** 指导时间 **/
 	private String guidanceTime;
 
+	private Integer prid;
+
+	private String supplement;
+
 	private String guidanceName;
 
+	public Integer getPrid() {
+		return prid;
+	}
+
+	public void setPrid(Integer prid) {
+		this.prid = prid;
+	}
+
+	public String getSupplement() {
+		return supplement;
+	}
+
+	public void setSupplement(String supplement) {
+		this.supplement = supplement;
+	}
+
 	public String getGuidanceName() {
 		return guidanceName;
 	}

+ 7 - 1
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -458,7 +458,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		fbb.setResult(result);
 		fbb.setFollowTime(followTime);
 		fbb.setUserBusinessList(list);	
-		customerService.addFollow(fbb,null);
+		customerService.addFollow(fbb,null,1);
 		return res;
 	}
 	
@@ -1362,6 +1362,12 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.data(customerService.updateUserName(uid,userName));
 		return res;
 	}
+	@RequestMapping(value = "/checkUserName",method = RequestMethod.GET)
+	public Result checkUserName(String userName){
+		Result res =new Result();
+		res.data(customerService.checkUserName(userName));
+		return res;
+	}
 
 	/** 修改客户关键资料 **/
 	@RequestMapping(value = "/updateUserDate", method = RequestMethod.POST)

+ 2 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -171,8 +171,9 @@ public interface CustomerService {
 	/**
 	 * 添加拜访记录
 	 * @param fbb
+	 * @param mainStatus 0辅助跟进 1主要跟进
 	 */
-	int addFollow(FollowBusinessBo fbb,String ufid) throws BusinessException;
+	int addFollow(FollowBusinessBo fbb,String ufid,Integer mainStatus) throws BusinessException;
 	
 	/**
 	 * 查询拜访记录详情

+ 10 - 2
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -630,13 +630,19 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 	@Override
 	public List<OrganizationContactBook> findCustomerContacts(String uid) {
-		List<OrganizationContactBook> list = userMapper.findCustomerContacts(uid, TokenManager.getAdminId());
+		List<OrganizationContactBook> list = userMapper.findCustomerContacts(uid, null);
+		for (OrganizationContactBook ob : list) {
+			if (!ob.getAid().equals(TokenManager.getAdminId())){
+				ob.setName("***");
+				ob.setMobile("***");
+			}
+		}
 		return list;
 	}
 
 	@Override
 	@Transactional
-	public int addFollow(FollowBusinessBo fbb,String ufid) throws BusinessException {
+	public int addFollow(FollowBusinessBo fbb,String ufid,Integer mainStatus) throws BusinessException {
 		// 更新跟进记录表
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		UserFollow userFollow = new UserFollow();
@@ -785,7 +791,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 			}
 		}
+		if (mainStatus==1){
 		followProject(fbb.getUid());
+		}
 		return 1;
 	}
 

+ 10 - 0
src/main/java/com/goafanti/order/bo/InputArrearsDunListBo.java

@@ -3,6 +3,7 @@ package com.goafanti.order.bo;
 public class InputArrearsDunListBo {
 	private String name;
 	private String  orderNo;
+	private String contractNo;
 	private String  starTime;
 	private String  endTime;
 	private String  tStarTime;
@@ -11,6 +12,15 @@ public class InputArrearsDunListBo {
 	private String  depId;
 	private Integer pageNo;
 	private Integer pageSize;
+
+	public String getContractNo() {
+		return contractNo;
+	}
+
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+
 	public String getName() {
 		return name;
 	}

+ 4 - 4
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -278,10 +278,10 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 * 催款统计列表
 	 */
 	@RequestMapping(value="/dunOrderNewList", method = RequestMethod.GET)
-	public Result dunOrderNewList(String name,String orderNo,String starTime,String endTime,Integer specially,
+	public Result dunOrderNewList(String name,String orderNo,String contractNo,String starTime,String endTime,Integer specially,
 			String adminName,String depId,Integer newStatus,Integer pageNo,Integer pageSize){
 		Result res=new Result();
-		res.data(orderNewService.dunOrderNewList(name, orderNo, starTime, endTime,specially,  adminName, depId,newStatus,pageNo, pageSize));
+		res.data(orderNewService.dunOrderNewList(name, orderNo,contractNo, starTime, endTime,specially,  adminName, depId,newStatus,pageNo, pageSize));
 		return res;
 	}
 	
@@ -494,11 +494,11 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 * @throws IOException 
 	 */
 	@RequestMapping(value = "/exportOrderDunData", method = RequestMethod.GET)
-	public Result exportOrderDunData(String name,String orderNo,String starTime,String endTime,Integer specially,String adminName,
+	public Result exportOrderDunData(String name,String orderNo,String contractNo,String starTime,String endTime,Integer specially,String adminName,
 			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response){
 		 Result res = new Result();
  		try {
- 			orderNewService.exportOrderDunData( name, orderNo, starTime, endTime, specially, adminName, depId,newStatus, pageNo, pageSize, response);
+ 			orderNewService.exportOrderDunData( name, orderNo,contractNo, starTime, endTime, specially, adminName, depId,newStatus, pageNo, pageSize, response);
 		} catch (Exception e) {
 			res.getError().add(buildError("格式不正确"));
 			return res;

+ 0 - 3
src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java

@@ -49,7 +49,6 @@ public class FundManagerOrderApiController extends CertifyApiController {
 	
 	/**
 	 * 财务管理员分派订单
-	 * @param orderid
 	 * @param financeId
 	 * @return
 	 */
@@ -232,7 +231,6 @@ public class FundManagerOrderApiController extends CertifyApiController {
 	
 	/**
 	 * 根据id查看订单流水数据
-	 * @param rid
 	 * @return
 	 */
 	@RequestMapping(value="/selectOneRefundFlow", method = RequestMethod.GET)
@@ -259,7 +257,6 @@ public class FundManagerOrderApiController extends CertifyApiController {
 	 * @param billNew
 	 * @param pageNo
 	 * @param pageSize
-	 * @param type 0自己 1所有
 	 * @return
 	 */
 	@RequestMapping(value="/myBillList", method = RequestMethod.GET)

+ 3 - 12
src/main/java/com/goafanti/order/controller/ProjectStatisticsApiController.java

@@ -74,20 +74,11 @@ public class ProjectStatisticsApiController extends CertifyApiController {
 	 * @throws IOException 
 	 */
 	@RequestMapping(value = "/exporProvincialList", method = RequestMethod.GET)
-	public Result exporProvincialList(HttpServletResponse response,InputProvincialStatistics ib) throws IOException{
+	public Result exporProvincialList(InputProvincialStatistics ib){
 		Result res=new Result();
-		try {
-			projectStatisticsService.exporProvincialList( response, ib);
-		} catch (Exception e) {
-			res.getError().add(buildError("格式不正确"));
-			e.printStackTrace();
-			return res;
+		return projectStatisticsService.exporProvincialList( ib);
 		}
-     res.data(1); 
-	return res;
-		
-	}
-	
+
 	
 	
 }

+ 2 - 2
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -99,7 +99,7 @@ public interface OrderNewService {
 	 * @param pageSize
 	 * @return
 	 */
-	Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo, String starTime, String endTime, Integer specially,String adminName,String depId,
+	Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo,String contractNo, String starTime, String endTime, Integer specially,String adminName,String depId,
 			Integer newStatus,Integer pageNo, Integer pageSize);
 	/**
 	 * 新增催款记录
@@ -157,7 +157,7 @@ public interface OrderNewService {
 	
 	boolean checkORderTask(String orderNo);
 	
-	void exportOrderDunData(String name,String orderNo,String starTime,String endTime,Integer specially,String adminName,
+	void exportOrderDunData(String name,String orderNo,String contractNo,String starTime,String endTime,Integer specially,String adminName,
 			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws  Exception;
 	
 	int updateOrderOver(String orderNo);

+ 2 - 1
src/main/java/com/goafanti/order/service/ProjectStatisticsService.java

@@ -4,6 +4,7 @@ import java.io.IOException;
 
 import javax.servlet.http.HttpServletResponse;
 
+import com.goafanti.common.bo.Result;
 import com.goafanti.order.bo.InputProjectStatistics;
 import com.goafanti.order.bo.InputProvincialStatistics;
 
@@ -15,6 +16,6 @@ public interface ProjectStatisticsService {
 
 	Object selectProvincialStatistics(InputProvincialStatistics is);
 
-	void exporProvincialList(HttpServletResponse response, InputProvincialStatistics ib)throws IOException;
+	Result exporProvincialList(InputProvincialStatistics ib);
 
 }

+ 8 - 0
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -132,6 +132,8 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	private TTaskMidMapper	tTaskMidMapper;
 	@Autowired
 	private UserLockReleaseMapper	userLockReleaseMapper;
+	@Autowired
+	private PushOrderService pushOrderService;
 	
 	Logger							logger	= LoggerFactory.getLogger(OrderChangeServiceImpl.class);
 	
@@ -249,6 +251,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			int isExamine=orderExamineMapper.selectByOrderNoAndAid(noc.getOrderNo(),TokenManager.getAdminId());
 			noc.setConsultantExamine(consultantExamine);
 			noc.setManagerExamine(managerExamine);
+			if (noc.getVoucherUrl()!=null) {
+				noc.setVoucherUrl(pushOrderService.changeProcessStatusConstant(noc.getVoucherUrl(),noc.getProcessState(),noc.getStatus()));
+			}
 			noc.setIsExamine(isExamine);
 		}
 		return list;
@@ -262,6 +267,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		nb.setConsultantExamine(consultantExamine);
 		nb.setManagerExamine(managerExamine);
 		nb.setIsExamine(isExamine);
+		if(nb.getProcessState()!=null){
+			nb.setVoucherUrl(pushOrderService.changeProcessStatusConstant(nb.getVoucherUrl(),nb.getProcessState(),nb.getStatus()));
+		}
 		return nb;
 	}
 	@Override

+ 26 - 15
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -182,6 +182,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	private PatentNewService	patentNewService;
 	@Autowired
 	private AsyncUtils	asyncUtils;
+	@Autowired
+	private PushOrderService pushOrderService;
 	
 	@Value(value = "${mobileRemindCodeTemplate}")
 	private String					mobileRemindCodeTemplate	= null;
@@ -556,6 +558,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Override
 	public TOrderNewBo getOrderNewDetail(String orderNo) {
 		TOrderNewBo tOrder= tOrderNewMapper.getOrderNewDetail(orderNo);
+		String url=pushOrderService.processStatusConstant(tOrder.getContractPictureUrl(),tOrder.getSalesmanId(),tOrder.getProcessStatus());
+		tOrder.setContractPictureUrl(url);
 		return tOrder;
 	}
 
@@ -739,7 +743,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	public void addNewDunNoticAndSendEmail(String  orderNo, OutNewOrderDunBo o) {
 		AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
 		TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(orderNo);
-		addNotic(orderNo,NoticeStatus.ORDER_DUN.getCode(),a, b);
+		addNotic(NoticeStatus.ORDER_DUN.getCode(),a, b);
 		try {
 			NewDunsendEmail(orderNo,o.getId(), a, b);
 		} catch (UnsupportedEncodingException | MessagingException e) {
@@ -749,7 +753,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	public void addTimingTaskNewDunNoticAndSendEmail(TOrderNew t2, OutNewOrderDunBo o) {
 		AdminListBo a = adminMapper.getDeptNameByAid("1");
 		TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(t2.getOrderNo());
-		addNotic(t2.getOrderNo(),NoticeStatus.ORDER_DUN.getCode(),a, b);
+		addNotic(NoticeStatus.ORDER_DUN.getCode(),a, b);
 		try {
 			NewDunsendEmail(t2.getOrderNo(),o.getId(), a, b);
 		} catch (UnsupportedEncodingException | MessagingException e) {
@@ -770,7 +774,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			//发送驳回邮件
 		if(SendEmailUtil.isEmail(b.getEmail())) {
 	    	 EmailBo bo = new EmailBo("催收通知", b.getEmail(), a.getDepartmentName(), a.getName(),
-						"", orderNo,new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),dunTypeName,a2.getName(),b.getUserName(),1,0);
+						"", orderNo,b.getContractNo(),new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),dunTypeName,a2.getName(),b.getUserName(),1,0);
 				if(StringUtils.isNotBlank(b.getEmail())) {
 					asyncUtils.patentSend(bo);
 				}
@@ -798,7 +802,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo, String starTime, String endTime,
+	public Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo,String contractNo, String starTime, String endTime,
 			Integer specially, String adminName,String depId,Integer newStatus,Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
@@ -809,6 +813,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
 		if (StringUtils.isNotBlank(adminName)) params.put("adminName", adminName);
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
+		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
 		Integer i=null;
@@ -1067,12 +1072,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	 * @throws IOException 
 	 */
 	@Override
-	public void exportOrderDunData(String name,String orderNo,String starTime,String endTime,Integer specially,String adminName,
+	public void exportOrderDunData(String name,String orderNo,String contractNo,String starTime,String endTime,Integer specially,String adminName,
 			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws Exception  {
 		OutputStream out = response.getOutputStream();
 		try {
 			@SuppressWarnings("unchecked")
-			List<outOrderDunListBo> list=(List<outOrderDunListBo>) dunOrderNewList( name,  orderNo,  starTime,  endTime,
+			List<outOrderDunListBo> list=(List<outOrderDunListBo>) dunOrderNewList( name,  orderNo, contractNo, starTime,  endTime,
 					 specially,  adminName, depId,newStatus, pageNo,  pageSize).getList();
 			
     		String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","签单金额","应收款","已收款","拨款比例","结算状态","未收款","项目状态","催收科目","催款状态","催款启动时间","签单时间"};
@@ -1220,23 +1225,25 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (type==NoticeStatus.ORDER_BACK.getCode())  id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
 		if (type==NoticeStatus.ORDER_APPROVA_NO.getCode())  id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
 		AdminListBo a = adminMapper.getDeptNameByAid(id);
-		 sendEmail(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo, t==null?null:t.getId(), a, b);
+		 sendEmail( t==null?null:t.getId(), a, b);
 		 
-		 addNotic(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo,type,a, b);
+		 addNotic(type,a, b);
 	}
-	public void addNotic(String orderNo,Integer type,AdminListBo a,TOrderNewBo b) {
-		String str=NoticeStatus.getValueByCode(type)+": 订单编号 -"+orderNo+", 操作人:"+a.getDepartmentName()+"-"+a.getName()+"。";
+	public void addNotic(Integer type,AdminListBo a,TOrderNewBo b) {
+		StringBuffer sb=new StringBuffer();
+		sb=sb.append(b.getUserName()).append(", 合同编号-").append(b.getContractNo())
+				.append(", 订单编号-").append(b.getOrderNo()).append(", 操作人: ").append(a.getDepartmentName()).append("-").append(a.getName()).append("。");
 		Notice n =new Notice();
 		n.setId(UUID.randomUUID().toString());
 		n.setAid(b.getSalesmanId());
 		n.setNoticeType(type);
-		n.setContent(str);
+		n.setContent(sb.toString());
 		n.setReaded(0);//未读
 		asyncUtils.addNotice(n);
 	}
-	public void  sendEmail(String orderNo,String dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
+	public void  sendEmail(String dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
 		LoggerUtils.debug(logger, "======================邮件信息发送===================");
-		String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + orderNo + "</div>";
+		String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + b.getOrderNo() + "</div><div>合同编号: " + b.getContractNo() + "</div>";
 		String tite="订单驳回";
 			if(StringUtils.isNotBlank(dunId)) {
 				TOrderDun tDun=tOrderDunMapper.selectByPrimaryKey(dunId);
@@ -1295,7 +1302,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (!nlist.isEmpty()&&StringUtils.isNotBlank(adminIds)) {
 			adminIds=adminIds.substring(0, adminIds.length()-1);
 			EmailBo bo = new EmailBo(NoticeStatus.getValueByCode(type), adminIds, a.getDepartmentName(), a.getName(), "请登录查看"
-					,null,null,null,null,null,0,approval);
+					,null,null,null,null,null,null,0,approval);
 			try {
 				//使用专利邮件模板
 				asyncUtils.patentSend(bo);
@@ -1415,6 +1422,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(in.getDepId())) params.put("depId", in.getDepId());
 		if (StringUtils.isNotBlank(in.getAdminName())) params.put("adminName", in.getAdminName());
 		if (StringUtils.isNotBlank(in.getOrderNo())) params.put("orderNo", in.getOrderNo());
+		if (StringUtils.isNotBlank(in.getContractNo())) params.put("contractNo", in.getContractNo());
 		if (StringUtils.isNotBlank(in.getStarTime())) params.put("starTime", in.getStarTime());
 		if (StringUtils.isNotBlank(in.getEndTime())) params.put("endTime", in.getEndTime()+" 23:59:59");
 		if (StringUtils.isNotBlank(in.gettStarTime())) params.put("tStarTime", in.gettStarTime());
@@ -1460,5 +1468,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
-	
+
+
+
+
 }

+ 1 - 1
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -655,7 +655,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			//发送驳回邮件
 		if(SendEmailUtil.isEmail(pnb.getEmail())) {
 	    	 EmailBo bo = new EmailBo("付款通知", pnb.getEmail(), "平台超管中心", "管理员",
-						"", pnb.getOrderNo(),pn.getPartyTimes(),
+						"", pnb.getOrderNo(),pnb.getContractNo(),pn.getPartyTimes(),
 						dunTypeName,pnb.getSalesmanName(),pnb.getUserName(),2,0);
 				if(StringUtils.isNotBlank(pnb.getEmail())) {
 					try {

+ 39 - 17
src/main/java/com/goafanti/order/service/impl/ProjectStatisticsServiceImpl.java

@@ -1,16 +1,16 @@
 package com.goafanti.order.service.impl;
 
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import javax.servlet.http.HttpServletResponse;
 
+import com.goafanti.common.bo.Result;
+import groovy.util.logging.Log4j;
 import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.util.CellRangeAddress;
@@ -18,6 +18,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.bo.Error;
@@ -34,8 +35,12 @@ import com.goafanti.order.enums.NewProjectStatus;
 import com.goafanti.order.service.ProjectStatisticsService;
 
 @Service
+@Log4j
 public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMapper> implements ProjectStatisticsService {
 
+	@Value("${upload.path}")
+	private String downloadPath;
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<OutProjectStatistics> selectTaskList(InputProjectStatistics ps) {
@@ -269,8 +274,9 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 	}
 
 	@Override
-	public void exporProvincialList(HttpServletResponse response, InputProvincialStatistics ib) throws IOException {
-		OutputStream out = response.getOutputStream();
+	public Result exporProvincialList(InputProvincialStatistics ib) {
+		OutputStream out = null;
+		XSSFWorkbook wb=null;
 		try {
 			if(ib.getPageSize()==null)ib.setPageSize(9999999);
 			if(ib.getStatus()==null)ib.setStatus(0);
@@ -306,8 +312,9 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
     		String[] ss= {"签单额(万元)","成本(万元)","利润(万元)"};
 			Collections.addAll(ls, ss);
     		comment= ls.toArray(new String[ls.size()]);
-    		String fileName ="项目数据统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-    		XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"项目数据统计");
+//    		String fileName ="项目数据统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
+			String filename = UUID.randomUUID().toString() + "_ProvincialList.xlsx";
+    		wb =ExportExcelUtil.exportTemplateInfoS(comment,"项目数据统计");
     		//根据列表编写文档
     		XSSFSheet sheet =wb.getSheetAt(0);
     		XSSFRow xr = sheet.createRow(sheet.getLastRowNum()+1);
@@ -352,21 +359,36 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
     				}
     				XSSFCell c = r.createCell(i);
     				c.setCellValue(o);
+
     			}
     		}
-    		//返回名称及参数
-			 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-			 response.setContentType("application/octet-stream;charset=utf-8");
-    		 // 返回数据流
+			String downloadPath = this.downloadPath+"/" + filename;
+			File desc = new File(downloadPath);
+			if (!desc.getParentFile().exists()) {
+				desc.getParentFile().mkdirs();
+			}
+			out=new FileOutputStream(downloadPath);
+    		// 返回数据流
 			 wb.write(out); 
-			 out.flush();
-			 out.close();
+			return new Result().data(filename);
 		} catch (Exception e) {
 			e.printStackTrace();
 			throw new BusinessException(new Error("表格生成错误。"));
 		}finally {
-			out.flush(); 
-			 out.close(); 
+			if (out != null) {
+				try {
+					out.close();
+				} catch (IOException e1) {
+					e1.printStackTrace();
+				}
+			}
+			if (wb !=null){
+				try {
+					wb.close();
+				} catch (IOException e1) {
+					e1.printStackTrace();
+				}
+			}
 		}
 	}
 

+ 193 - 0
src/main/java/com/goafanti/order/service/impl/PushOrderService.java

@@ -0,0 +1,193 @@
+package com.goafanti.order.service.impl;
+
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminMapper;
+
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
+
+import com.goafanti.order.enums.ProcessStatus;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PushOrderService {
+    public static String   DEFAULTS_URL="/image/noPermission.jpg";
+
+    @Autowired
+    private AdminMapper adminMapper;
+
+    /**
+     * 根据角色判断是否可以查看合同图片
+     * @param url 合同地址
+     * @param aid 营销id
+     * @param approval 特批
+     * @param orderDep 订单编号
+     * @return
+     */
+    public  String  ShiroConstant(String url,String aid,Integer approval,String orderDep){
+        if (StringUtils.isNotNull(url)) {
+            //暂时开放营销管理员可以查看
+            if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION) ||
+                    TokenManager.hasRole(AFTConstants.CUSTOMER_SERVICE) || TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)
+            || TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)|| TokenManager.hasRole(AFTConstants.OUTSOURCE_AUDITOR)) {
+                return url;
+            } else if (TokenManager.hasRole(AFTConstants.CED)) {
+                if (approval == 1) {
+                    return url;
+                } else {
+                    return url;
+                }
+            } else if (TokenManager.hasRole(AFTConstants.FINANCE)) {
+                List<String> deps = adminMapper.getFinanceDep(TokenManager.getAdminId());
+                boolean flag = false;
+                for (String dep : deps) {
+                    if (dep.equals(orderDep)) {
+                        flag = true;
+                        break;
+                    }
+                }
+                if (flag) {
+                    return url;
+                } else {
+                    return DEFAULTS_URL;
+                }
+
+            } else if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
+                List<String> deps = adminMapper.getLowerFinanceDep(TokenManager.getAdminId());
+                boolean flag = false;
+                for (String dep : deps) {
+                    if (orderDep.equals(deps)) {
+                        flag = true;
+                        break;
+                    }
+                }
+                if (flag) {
+                    return url;
+                } else {
+                    return DEFAULTS_URL;
+                }
+            } else if (TokenManager.hasRole(AFTConstants.SALESMAN)) {
+                if (TokenManager.getAdminId().equals(aid)) {
+                    return url;
+                } else {
+                    return DEFAULTS_URL;
+                }
+            } else {
+                return DEFAULTS_URL;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 根据流程与角色判断是否可以查看订单合同
+     * @param url
+     * @param aid
+     * @param processStatus
+     * @return
+     */
+    public String processStatusConstant(String url,String aid,Integer processStatus){
+        //流程状态 0-已派营销员,1-已派营销员管理员,2-已派财务管理员,3-已派财务专员,4-已派咨询师管理员,5-已部分派咨询师经理,6-已部全部派咨询师经理
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION) ||
+                TokenManager.hasRole(AFTConstants.CED) ){
+            return url;
+        }else if (((TokenManager.hasRole(AFTConstants.SALESMAN)||TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)))&&
+                TokenManager.getAdminId().equals(aid)){
+            return url;
+        }else if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)&&processStatus== ProcessStatus.YPYXGLY.getCode()){
+            return url;
+        }else if (TokenManager.hasRole(AFTConstants.FINANCE)&&processStatus== ProcessStatus.YPCWZY.getCode()){
+            return url;
+        }else if (TokenManager.hasRole(AFTConstants.TECH_ADMIN)&&processStatus== ProcessStatus.YPZXSGLY.getCode()){
+            return url;
+        }else{
+            return DEFAULTS_URL;
+        }
+    }
+
+
+    /**
+     * 根据变更流程判断是否可以查看
+     *
+     * @param url
+     * @param processStatus
+     * @param status 在流程走完则要财务退票 状态 0草稿 1审核中 2通过 3驳回 4完成 5撤销 2是流程走完但是还停留在财务退票,4才是完全走完流程
+     * @return
+     */
+    public String changeProcessStatusConstant(String url,Integer processStatus,Integer status){
+        boolean flag=false;
+        //流程状态 0营销员 1营销管理员 2技术员 3技术经理 4技术总监 5财务专员(退单) 6财务总监 7总裁 8董事长 9 财务专员(非退单)
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION) ||
+                TokenManager.hasRole(AFTConstants.CED) ){
+            flag=true;
+        }else{
+            switch (processStatus) {
+                case 0:
+                    if(TokenManager.hasRole(AFTConstants.SALESMAN)||TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
+                        flag=true;
+                    }
+                    break;
+                case 1:
+                    if(TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
+                        flag=true;
+                    }
+                    break;
+                case 2:
+                    if(TokenManager.hasRole(AFTConstants.TECH)){
+                        flag=true;
+                    }
+                    break;
+                case 3:
+                    if(TokenManager.hasRole(AFTConstants.TECH_MANAGER)){
+                        flag=true;
+                    }
+                    break;
+                case 4:
+                    if(TokenManager.hasRole(AFTConstants.TECH_ADMIN)){
+                        flag=true;
+                    }
+                    break;
+                case 5:
+                    if(TokenManager.hasRole(AFTConstants.FINANCE)){
+                        flag=true;
+                    }
+                    break;
+                case 6:
+                    if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)){
+                        flag=true;
+                    }
+                    break;
+                case 7:
+
+                    if((TokenManager.hasRole(AFTConstants.CED)&&status!=2)||
+                            (TokenManager.hasRole(AFTConstants.FINANCE)&&status==2)){
+                        flag=true;
+                    }
+                    break;
+                case 8:
+                    if((TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)&&status!=2)||
+                            (TokenManager.hasRole(AFTConstants.FINANCE)&&status==2)){
+                        flag=true;
+                    }
+                    break;
+                case 9:
+                    if(TokenManager.hasRole(AFTConstants.FINANCE)){
+                        flag=true;
+                    }
+                    break;
+
+            }
+        }
+        if (flag){
+            return url;
+        }else {
+            return DEFAULTS_URL;
+        }
+    }
+
+
+}

+ 0 - 1
src/main/java/com/goafanti/patent/controller/AdminPatentNewApiController.java

@@ -152,7 +152,6 @@ public class AdminPatentNewApiController extends CertifyApiController {
 	/**
 	 * 	Excel批量导入专利
      * 
-     * @param response
      * @return
      */
     @RequestMapping(value = "/import" , method = RequestMethod.POST)

+ 9 - 10
src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java

@@ -91,8 +91,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		PatentNew pn=patentNewMapper.selectByPrimaryKey(p.getId());
 		StringBuffer str=new StringBuffer(a.getName());
 		if (!p.getApplyDate().equals(pn.getApplyDate()) 
-				|| p.getType() != pn.getType()
-				|| ! p.getTid().equals(pn.getTid())) {
+				|| p.getType() != pn.getType()) {
 			p.setYears(getyear(p));
 			p.setPatentAmount(sumAmout(p.getType(),p.getTid(),p.getYears()));
 			 if(p.getPatentAmount()==null) {
@@ -505,14 +504,12 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			Calendar apply =Calendar.getInstance();
 			apply.setTime(trb.getApplyDate());
 			List<PatentPaymentDetails> list =new ArrayList<PatentPaymentDetails>();
-			
 			for (int i = 1; i < 21; i++) {
 				PatentPaymentDetails pd=new PatentPaymentDetails();
 				if ((trb.getType()==0||trb.getType()==2)&&i<11) {
 						addParam(trb, apply, i, pd);
 						list.add(pd);
 				}else if (trb.getType()==1) {
-					
 					addParam(trb, apply, i, pd);
 					list.add(pd);
 				}
@@ -522,7 +519,6 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			return list;
 		}
 		return null;
-		
 	}
 
 	private void addParam(PatentNew trb, Calendar apply, int i, PatentPaymentDetails pd) {
@@ -546,13 +542,16 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		}
 		for (PatentYearPayment p : patentYear) {
 			if (type==p.getType()&&year==p.getYear()) {
-				TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(tid);
-				if (t!=null&&t.getCostReduction()!=null&& t.getCostReduction()==1) {
-					return p.getReductionAmount();
-				}else {
+				if (tid==null){
 					return p.getPatentAmount();
+				}else{
+					TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(tid);
+					if (t!=null&&t.getCostReduction()!=null&& t.getCostReduction()==1) {
+						return p.getReductionAmount();
+					}else {
+						return p.getPatentAmount();
+					}
 				}
-				
 			}
 		}
 		return null;

+ 64 - 0
src/main/java/com/goafanti/user/bo/outUserFollowList.java

@@ -29,6 +29,70 @@ public class outUserFollowList {
     private String guidance;
     @Excel(name = "指导时间")
     private String guidanceTimes;
+    private String contacts;
+    private String contactMobile;
+    private Integer province;
+    private Integer city;
+    private Integer area;
+    private String intendedProject;
+    private String businessScope;
+
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getContactMobile() {
+        return contactMobile;
+    }
+
+    public void setContactMobile(String contactMobile) {
+        this.contactMobile = contactMobile;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public Integer getCity() {
+        return city;
+    }
+
+    public void setCity(Integer city) {
+        this.city = city;
+    }
+
+    public Integer getArea() {
+        return area;
+    }
+
+    public void setArea(Integer area) {
+        this.area = area;
+    }
+
+    public String getIntendedProject() {
+        return intendedProject;
+    }
+
+    public void setIntendedProject(String intendedProject) {
+        this.intendedProject = intendedProject;
+    }
+
+    public String getBusinessScope() {
+        return businessScope;
+    }
+
+    public void setBusinessScope(String businessScope) {
+        this.businessScope = businessScope;
+    }
 
     public String getFollowTimes() {
         return followTimes;

+ 30 - 3
src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java

@@ -8,11 +8,38 @@ public class InputPublicDtails {
 	private String uid;
 	private Integer status;
 	private Integer clockIn;
+	/**
+	 * type 0个人 1部门 2全部
+	 */
+	private Integer type;
+	private String sid;
+	private String depId;
 	private Integer pageSize;
 	private Integer pageNo;
-	
-	
-	
+
+	public String getSid() {
+		return sid;
+	}
+
+	public void setSid(String sid) {
+		this.sid = sid;
+	}
+
+	public String getDepId() {
+		return depId;
+	}
+
+	public void setDepId(String depId) {
+		this.depId = depId;
+	}
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
 
 	public String getAid() {
 		return aid;

+ 50 - 2
src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java

@@ -4,10 +4,13 @@ import com.goafanti.common.utils.excel.Excel;
 
 public class OutPublicDtails {
 
+	private Integer id;
 	@Excel(name = "客户名称")
 	private String nickname;
 	@Excel(name = "公出地点")
 	private String userName;
+	@Excel(name = "跟单人")
+	private String sname;
 	@Excel(name = "公出申请人")
 	private String aname;
 	@Excel(name = "公出时长")
@@ -24,10 +27,55 @@ public class OutPublicDtails {
 	private String clockInTimes;
 	@Excel(name = "创建时间" )
 	private String createTimes;
+	@Excel(name = "公出原因" )
+	private String remarks;
+	@Excel(name = "审核信息" )
+	private String auditInfo;
+	@Excel(name = "公出补充" )
+	private String supplement;
 	private String annexUrl;
 	private String photoUrl;
-	
-	
+
+	public String getSname() {
+		return sname;
+	}
+
+	public void setSname(String sname) {
+		this.sname = sname;
+	}
+
+	public String getSupplement() {
+		return supplement;
+	}
+
+	public void setSupplement(String supplement) {
+		this.supplement = supplement;
+	}
+
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public String getRemarks() {
+		return remarks;
+	}
+
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	public String getAuditInfo() {
+		return auditInfo;
+	}
+
+	public void setAuditInfo(String auditInfo) {
+		this.auditInfo = auditInfo;
+	}
+
 	public String getCreateTimes() {
 		return createTimes;
 	}

+ 15 - 1
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -33,7 +33,6 @@ public class AdminReleaseApiController extends CertifyApiController{
 	
 	/**
 	 * 发起外出申请
-	 * @return
 	 */
 	@RequestMapping(value = "/addPublicRelease", method = RequestMethod.POST)
 	public Result addPublicRelease(InputPublicRelease in){
@@ -203,6 +202,21 @@ public class AdminReleaseApiController extends CertifyApiController{
 		res.setData(handleFile(res, "/publicRelease/", false, req, "publicRelease"));
 		return res;
 	}
+
+	/**
+	 * 搜索
+	 * @return
+	 */
+	@RequestMapping(value = "/addSupplement", method = RequestMethod.POST)
+	public Result addSupplement(Integer id,String supplement){
+		Result res =new Result();
+		if (id==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
+			return res;
+		}
+		res.setData(publicReleaseService.addSupplement( id ,supplement));
+		return res;
+	}
 	
 	
 	

+ 1 - 0
src/main/java/com/goafanti/weChat/service/PublicReleaseService.java

@@ -42,4 +42,5 @@ public interface PublicReleaseService {
 
 	List<OutPublicDtails> publicReleaseListDtailsList(InputPublicDtails in);
 
+    int addSupplement(Integer id,String supplement);
 }

+ 41 - 18
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.Map;
 import java.util.UUID;
 
 
+import com.goafanti.order.service.OrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.socket.TextMessage;
@@ -60,6 +61,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	@Autowired
 	private CustomerService customerService;
 	@Autowired
+	private OrderService orderService;
+	@Autowired
 	private WeChatUtils weChatUtils;
 	@Autowired
 	private AdminMapper adminMapper;
@@ -77,14 +80,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		Date date =new Date();
 		in.setCreateTime(date);
 		in.setStatus(1);
-		in.setAid(TokenManager.getAdminId());
-		in.setNewUser(0);
+		String aid=TokenManager.getAdminId();
+		in.setAid(aid);
 		User u=userMapper.selectByPrimaryKey(in.getUid());
-		if (u!=null&&u.getShareType()==2){
-			in.setNewUser(1);
-		}
-		if (u.getAid().equals(TokenManager.getAdminId())){
-			in.setMainStatus(1);
+		if (u.getAid().equals(aid)){
+			in.setMianStatus(1);
+		}else{
+			in.setMianStatus(0);
 		}
 		publicReleaseMapper.insertSelectiveGetId(in);
 		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
@@ -92,11 +94,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		PublicReleaseLog log=new PublicReleaseLog(in.getId(),TokenManager.getAdminId(),1,"发起外出申请",new Date());
 		publicReleaseLogMapper.insertSelective(log);
 		String openid=a.getOpenId();
-
 		String str="["+my.getName()+"]发起["+u.getNickname()+"]的外出申请,请及时审核。";
 		sendNoticeAndSoucket(a.getId(),NoticeStatus.PUBLIC_RELEASE_START.getCode(),str);
 		Map<String, Object>map=new HashMap<String, Object>();
-		map.put("id", in.getId());
+		map.put("data", publicReleaseMapper.selectDtails(in.getId(),null));
 		if (openid!=null) {
 			Integer res= weChatUtils.addNotice(openid, in.getStatus(),in.getId(),date,my.getName(),"["+my.getName()+"]发起外出申请");
 			if (res!=0) {
@@ -192,12 +193,20 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	public int pushExaminePublicRelease(Integer id, Integer status, String remarks,Double duration) {
 		PublicRelease p=new PublicRelease();
 		Date date =new Date();
+		String aid=TokenManager.getAdminId();
 		p.setId(id);
 		p.setStatus(status);
 		PublicRelease use=publicReleaseMapper.selectByPrimaryKey(id);
 		if (use.getStatus()!=1) {
 			throw new BusinessException("只能修改已发起的状态");
 		}
+		StringBuffer str=new StringBuffer();
+		Admin ad=adminMapper.selectByPrimaryKey(aid);
+		str=str.append("(").append(ad.getName()).append(")");
+		if (status==0){str=str.append("驳回,");}
+		else if(status==2){str=str.append("同意,");}
+		str=str.append(remarks);
+		p.setAuditInfo(str.toString());
 		publicReleaseMapper.updateByPrimaryKeySelective(p);
 		PublicReleaseLog log=new PublicReleaseLog(id,TokenManager.getAdminId(),status,remarks,new Date());
 		publicReleaseLogMapper.insertSelective(log);
@@ -257,7 +266,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			fbb.setFollowTime(DateUtils.formatDate(p.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
 			String ufid=UUID.randomUUID().toString();
 			p.setUfid(ufid);
-			customerService.addFollow(fbb,ufid);
+			customerService.addFollow(fbb,ufid,use.getMianStatus());
 			str="公出人员打卡";
 		}else {
 			str="刷新打卡";
@@ -275,10 +284,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		//如果不是本人和审核人员则不返回信息
 		if(out!=null&&!TokenManager.getAdminId().equals( out.getAid())&&!TokenManager.getAdminId().equals(out.getSuprId())) {
 			out=null;
-		}else if(TokenManager.getAdminId().equals(out.getSuprId())) {
-			out.setPermission(1);
-		}else {
+		}else if(TokenManager.getAdminId().equals(out.getAid())) {
 			out.setPermission(0);
+		}else {
+			out.setPermission(1);
 		}
 		return out;	 
 	}
@@ -325,11 +334,23 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	public Object publicReleaseListDtails(InputPublicDtails in) {
 		Map<String,Object> map =new HashMap<String, Object>();
 		if(in.getAid()!=null)map.put("aid", in.getAid());
+		if(in.getSid()!=null)map.put("sid", in.getSid());
+		if(in.getDepId()!=null)map.put("depId", in.getDepId());
 		if(in.getReleaseStart()!=null)map.put("releaseStart", in.getReleaseStart());
 		if(in.getReleaseEnd()!=null)map.put("releaseEnd", in.getReleaseEnd()+" 23:59:59");
 		if(in.getUid()!=null)map.put("uid", in.getUid());
 		if(in.getStatus()!=null)map.put("status", in.getStatus());
 		if(in.getClockIn()!=null)map.put("clockIn", in.getClockIn());
+		if(TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)){in.setType(2);}
+		else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)){
+			in.setType(1);
+			map.put("deps", orderService.selectMyDeps());
+		} else{
+			in.setType(0);
+			if (in.getAid()==null)map.put("aid",TokenManager.getAdminId());
+		}
+		map.put("type",in.getType());
+
 		return (Pagination<OutPublicDtails>) findPage("listPublicDtails", "countPublicDtails", map, in.getPageNo(), in.getPageSize());
 	}
 	
@@ -345,11 +366,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return (List<OutPublicDtails>) findList("listPublicDtails", map, in.getPageNo(), 99999);
 	}
 
-
-
-
-
-
+	@Override
+	public int addSupplement(Integer id,String supplement) {
+		PublicRelease pr=new PublicRelease();
+		pr.setId(id);
+		pr.setSupplement(supplement);
+		return publicReleaseMapper.updateByPrimaryKeySelective(pr);
+	}
 
 
 	@Override

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -47,7 +47,7 @@ avatar.upload.host=//sb.jishutao.com/upload
 #avatar.host=//172.16.0.253
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.89
+static.host=//static.jishutao.com/1.1.94
 
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=081744369d42405be58fe37f892631f7

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -41,7 +41,7 @@ user.private.max=1000
 #客户释放提醒
 user_remind_days=15
 
-static.host=//static.jishutao.com/1.1.89
+static.host=//static.jishutao.com/1.1.94
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload

+ 2 - 3
src/main/webapp/WEB-INF/views/common.html

@@ -354,8 +354,6 @@
 			globalConfig.avatarUploadHost = /*[[${avatarUploadHost}]]*/'';
 			globalConfig.csrfToken = /*[[${csrf}]]*/'';
 			globalConfig.kfqq = '2035994611';
-			window.userData = {};
-			window.adminData = {};
 			/*]]>*/
 		</script>
 		<script th:inline="javascript" th:if="${adminData!=null}">
@@ -368,7 +366,8 @@
 				uid : /*[[${adminData.id}]]*/'',
 				departmentId : /*[[${adminData.departmentId}]]*/'',
 				isSuperAdmin : /*[[${shiro.hasRole('999999')}]]*/false,
-				isApprovalDecision : /*[[${shiro.hasRole('99999')}]]*/false
+				isApprovalDecision : /*[[${shiro.hasRole('99999')}]]*/false,
+				role :/*[[${role}]]*/''
 			}
 			window.showUserManage = /*[[${shiro.hasRole('999999') || shiro.isPermitted('admin/userManage')}]]*/false;
 			window.showServices = /*[[${shiro.hasRole('999999') || shiro.isPermitted('admin/services')}]]*/false;