anderx лет назад: 5
Родитель
Сommit
2ef137c929

+ 200 - 198
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -1,199 +1,201 @@
-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;
-
-public interface AdminMapper {
-    /**
-	 * 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);
-
-	/**
-	 * 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);
-
-	/**
-	 * 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);
-
-	Pagination<AppAdminListBo> consultantList();
-	
-	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);
-	
-	/**
-	 * 查询订单变更信息通知�??
-	 * @param orderNo
-	 * @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);
-
-	List<Admin> selectAllAdmin(@Param("depId")String depId);
-
-	int updateLockIds(@Param("lockIds")String lockIds);
-
-	List<AdminListBo> getListDefaultPassword(String id);
-
-	int getCountById(String id);
-	AdminListBo getDeptNameByAid(String id);
-
-	List<Admin> getAdminRoleList(String roleName);
-
-	int addAdminContacts(AdminContacts a);
-
-	int deleteFrequentContacts(String id);
-
-	List<String> getaidFrequentContacts(String id);
-
-	List<String> listNameByDepAndName(@Param("depId")String depId,@Param("roleName")String roleName);
-
-	List<String> selectBySuperId(String aid);
-
-	Admin selectFinanceAdminByOrderDep(String orderDep);
-
-	String getPermission(String transferId);
-	
+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;
+
+public interface AdminMapper {
+    /**
+	 * 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);
+
+	/**
+	 * 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);
+
+	/**
+	 * 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);
+
+	Pagination<AppAdminListBo> consultantList();
+	
+	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);
+	
+	/**
+	 * 查询订单变更信息通知�??
+	 * @param orderNo
+	 * @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);
+
+	List<Admin> selectAllAdmin(@Param("depId")String depId);
+
+	int updateLockIds(@Param("lockIds")String lockIds);
+
+	List<AdminListBo> getListDefaultPassword(String id);
+
+	int getCountById(String id);
+	AdminListBo getDeptNameByAid(String id);
+
+	List<Admin> getAdminRoleList(String roleName);
+
+	int addAdminContacts(AdminContacts a);
+
+	int deleteFrequentContacts(String id);
+
+	List<String> getaidFrequentContacts(String id);
+
+	List<String> listNameByDepAndName(@Param("depId")String depId,@Param("roleName")String roleName);
+
+	List<String> selectBySuperId(String aid);
+
+	Admin selectFinanceAdminByOrderDep(String orderDep);
+
+	String getPermission(String transferId);
+
+	List<String> selectDepIdWithSpuerId(String superId);
+	
 }

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


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


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


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


+ 374 - 373
src/main/java/com/goafanti/order/bo/TOrderBonusBo.java

@@ -1,373 +1,374 @@
-package com.goafanti.order.bo;
-
-import java.math.BigDecimal;
-
-import com.goafanti.common.model.TOrderBonus;
-
-public class TOrderBonusBo extends TOrderBonus{
-	
-	private String targetName; //发放目标(可以是技术员和营销员)
-	
-	private String byName; //发放人
-	
-	private String salesName;//订单负责人
-	
-	private String commodityName;
-	
-	private Integer tid; //任务数量
-	
-	private Integer commodityQuantity; //任务数量
-	
-	private BigDecimal commodityPrice; //价格
-	
-	private Integer taskStatus; //任务状态
-	
-	private Integer liquidationStatus; //订单结算状态
-	
-	private String taskAllocator; //任务分配人
-	
-	private String taskReceiver; //任务负责人
-	
-	private Integer projectStatus; //项目状态
-	
-	private String acceptTime; //受理时间
-	
-	private String reviewTime; //评审日期
-	
-	private String publicityTime; //公示日期
-	
-	private String licenceTime; // 发证日期
-	
-	private String signTime; // 签单日期
-	
-	private String departmentId; // 部门id
-	private String departmentName; // 部门名称
-	private String startTime;
-	private String endTime;
-	private String startTime1;
-	private String endTime1;
-	
-	private String buyId;
-	private String saleId;
-	private String buyName;
-	private BigDecimal totalAmount; //签单金额
-	private BigDecimal firstAmount; //首付
-	private BigDecimal settlementAmount; //已收
-	private BigDecimal refundAmount; //已付
-	
-	private Integer orderStatus; //订单状态
-	private Float proofCount; //校对量
-	private Integer proofStatus; //校对状态
-	
-	private String kejim;
-	private String renzm;
-	private String kejiy;
-	private String renzy;
-	
-	private Integer main;
-
-	public String getTargetName() {
-		return targetName;
-	}
-
-	public void setTargetName(String targetName) {
-		this.targetName = targetName;
-	}
-
-	public String getByName() {
-		return byName;
-	}
-
-	public Integer getTid() {
-		return tid;
-	}
-
-	public void setTid(Integer tid) {
-		this.tid = tid;
-	}
-
-	public void setByName(String byName) {
-		this.byName = byName;
-	}
-
-	public String getCommodityName() {
-		return commodityName;
-	}
-
-	public void setCommodityName(String commodityName) {
-		this.commodityName = commodityName;
-	}
-
-	public Integer getCommodityQuantity() {
-		return commodityQuantity;
-	}
-
-	public void setCommodityQuantity(Integer commodityQuantity) {
-		this.commodityQuantity = commodityQuantity;
-	}
-
-	public BigDecimal getCommodityPrice() {
-		return commodityPrice;
-	}
-
-	public void setCommodityPrice(BigDecimal commodityPrice) {
-		this.commodityPrice = commodityPrice;
-	}
-
-	public Integer getTaskStatus() {
-		return taskStatus;
-	}
-
-	public void setTaskStatus(Integer taskStatus) {
-		this.taskStatus = taskStatus;
-	}
-
-	public String getTaskAllocator() {
-		return taskAllocator;
-	}
-
-	public void setTaskAllocator(String taskAllocator) {
-		this.taskAllocator = taskAllocator;
-	}
-
-	public String getTaskReceiver() {
-		return taskReceiver;
-	}
-
-	public void setTaskReceiver(String taskReceiver) {
-		this.taskReceiver = taskReceiver;
-	}
-
-	public Integer getProjectStatus() {
-		return projectStatus;
-	}
-
-	public void setProjectStatus(Integer projectStatus) {
-		this.projectStatus = projectStatus;
-	}
-
-	public String getAcceptTime() {
-		return acceptTime;
-	}
-
-	public void setAcceptTime(String acceptTime) {
-		this.acceptTime = acceptTime;
-	}
-
-	public String getReviewTime() {
-		return reviewTime;
-	}
-
-	public void setReviewTime(String reviewTime) {
-		this.reviewTime = reviewTime;
-	}
-
-	public String getPublicityTime() {
-		return publicityTime;
-	}
-
-	public void setPublicityTime(String publicityTime) {
-		this.publicityTime = publicityTime;
-	}
-
-	public String getLicenceTime() {
-		return licenceTime;
-	}
-
-	public void setLicenceTime(String licenceTime) {
-		this.licenceTime = licenceTime;
-	}
-
-	public Integer getMain() {
-		return main;
-	}
-
-	public void setMain(Integer main) {
-		this.main = main;
-	}
-
-	public Integer getLiquidationStatus() {
-		return liquidationStatus;
-	}
-
-	public void setLiquidationStatus(Integer liquidationStatus) {
-		this.liquidationStatus = liquidationStatus;
-	}
-
-	public String getStartTime() {
-		return startTime;
-	}
-
-	public void setStartTime(String startTime) {
-		this.startTime = startTime;
-	}
-
-	public String getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(String endTime) {
-		this.endTime = endTime;
-	}
-
-	public String getSalesName() {
-		return salesName;
-	}
-
-	public void setSalesName(String salesName) {
-		this.salesName = salesName;
-	}
-
-	public String getDepartmentId() {
-		return departmentId;
-	}
-
-	public void setDepartmentId(String departmentId) {
-		this.departmentId = departmentId;
-	}
-
-	public String getSignTime() {
-		return signTime;
-	}
-
-	public void setSignTime(String signTime) {
-		this.signTime = signTime;
-	}
-
-	public String getBuyId() {
-		return buyId;
-	}
-
-	public void setBuyId(String buyId) {
-		this.buyId = buyId;
-	}
-
-	public String getSaleId() {
-		return saleId;
-	}
-
-	public void setSaleId(String saleId) {
-		this.saleId = saleId;
-	}
-
-	public String getBuyName() {
-		return buyName;
-	}
-
-	public void setBuyName(String buyName) {
-		this.buyName = buyName;
-	}
-
-	public BigDecimal getTotalAmount() {
-		return totalAmount;
-	}
-
-	public void setTotalAmount(BigDecimal totalAmount) {
-		this.totalAmount = totalAmount;
-	}
-
-	public BigDecimal getFirstAmount() {
-		return firstAmount;
-	}
-
-	public void setFirstAmount(BigDecimal firstAmount) {
-		this.firstAmount = firstAmount;
-	}
-
-	public BigDecimal getSettlementAmount() {
-		return settlementAmount;
-	}
-
-	public void setSettlementAmount(BigDecimal settlementAmount) {
-		this.settlementAmount = settlementAmount;
-	}
-
-	public BigDecimal getRefundAmount() {
-		return refundAmount;
-	}
-
-	public void setRefundAmount(BigDecimal refundAmount) {
-		this.refundAmount = refundAmount;
-	}
-
-	public Integer getOrderStatus() {
-		return orderStatus;
-	}
-
-	public void setOrderStatus(Integer orderStatus) {
-		this.orderStatus = orderStatus;
-	}
-
-	public Float getProofCount() {
-		return proofCount;
-	}
-
-	public void setProofCount(Float proofCount) {
-		this.proofCount = proofCount;
-	}
-
-	public String getDepartmentName() {
-		return departmentName;
-	}
-
-	public void setDepartmentName(String departmentName) {
-		this.departmentName = departmentName;
-	}
-
-	public String getKejim() {
-		return kejim;
-	}
-
-	public void setKejim(String kejim) {
-		this.kejim = kejim;
-	}
-
-	public String getRenzm() {
-		return renzm;
-	}
-
-	public void setRenzm(String renzm) {
-		this.renzm = renzm;
-	}
-
-	public String getKejiy() {
-		return kejiy;
-	}
-
-	public void setKejiy(String kejiy) {
-		this.kejiy = kejiy;
-	}
-
-	public String getRenzy() {
-		return renzy;
-	}
-
-	public void setRenzy(String renzy) {
-		this.renzy = renzy;
-	}
-
-	public Integer getProofStatus() {
-		return proofStatus;
-	}
-
-	public void setProofStatus(Integer proofStatus) {
-		this.proofStatus = proofStatus;
-	}
-
-	public String getStartTime1() {
-		return startTime1;
-	}
-
-	public void setStartTime1(String startTime1) {
-		this.startTime1 = startTime1;
-	}
-
-	public String getEndTime1() {
-		return endTime1;
-	}
-
-	public void setEndTime1(String endTime1) {
-		this.endTime1 = endTime1;
-	}
-	
-}
+package com.goafanti.order.bo;
+
+import java.math.BigDecimal;
+
+import com.goafanti.common.model.TOrderBonus;
+
+public class TOrderBonusBo extends TOrderBonus{
+	
+	private String targetName; //发放目标(可以是技术员和营销员)
+	
+	private String byName; //发放人
+	
+	private String salesName;//订单负责人
+	
+	private String commodityName;
+	
+	private Integer tid; //任务数量
+	
+	private Integer commodityQuantity; //任务数量
+	
+	private BigDecimal commodityPrice; //价格
+	
+	private Integer taskStatus; //任务状态
+	
+	private Integer liquidationStatus; //订单结算状态
+	
+	private String taskAllocator; //任务分配人
+	
+	private String taskReceiver; //任务负责人
+	
+	private Integer projectStatus; //项目状态
+	
+	private String acceptTime; //受理时间
+	
+	private String reviewTime; //评审日期
+	
+	private String publicityTime; //公示日期
+	
+	private String licenceTime; // 发证日期
+	
+	private String signTime; // 签单日期
+	
+	private String departmentId; // 部门id
+	private String departmentName; // 部门名称
+	private String startTime;
+	private String endTime;
+	private String startTime1;
+	private String endTime1;
+	
+	private String buyId;
+	private String saleId;
+	private String buyName;
+	private BigDecimal totalAmount; //签单金额
+	private BigDecimal firstAmount; //首付
+	private BigDecimal settlementAmount; //已收
+	private BigDecimal refundAmount; //已付
+	
+	private Integer orderStatus; //订单状态
+	private Float proofCount; //校对量
+	private Integer proofStatus; //校对状态
+	
+	
+	private String kejim;
+	private String renzm;
+	private String kejiy;
+	private String renzy;
+	
+	private Integer main;
+
+	public String getTargetName() {
+		return targetName;
+	}
+
+	public void setTargetName(String targetName) {
+		this.targetName = targetName;
+	}
+
+	public String getByName() {
+		return byName;
+	}
+
+	public Integer getTid() {
+		return tid;
+	}
+
+	public void setTid(Integer tid) {
+		this.tid = tid;
+	}
+
+	public void setByName(String byName) {
+		this.byName = byName;
+	}
+
+	public String getCommodityName() {
+		return commodityName;
+	}
+
+	public void setCommodityName(String commodityName) {
+		this.commodityName = commodityName;
+	}
+
+	public Integer getCommodityQuantity() {
+		return commodityQuantity;
+	}
+
+	public void setCommodityQuantity(Integer commodityQuantity) {
+		this.commodityQuantity = commodityQuantity;
+	}
+
+	public BigDecimal getCommodityPrice() {
+		return commodityPrice;
+	}
+
+	public void setCommodityPrice(BigDecimal commodityPrice) {
+		this.commodityPrice = commodityPrice;
+	}
+
+	public Integer getTaskStatus() {
+		return taskStatus;
+	}
+
+	public void setTaskStatus(Integer taskStatus) {
+		this.taskStatus = taskStatus;
+	}
+
+	public String getTaskAllocator() {
+		return taskAllocator;
+	}
+
+	public void setTaskAllocator(String taskAllocator) {
+		this.taskAllocator = taskAllocator;
+	}
+
+	public String getTaskReceiver() {
+		return taskReceiver;
+	}
+
+	public void setTaskReceiver(String taskReceiver) {
+		this.taskReceiver = taskReceiver;
+	}
+
+	public Integer getProjectStatus() {
+		return projectStatus;
+	}
+
+	public void setProjectStatus(Integer projectStatus) {
+		this.projectStatus = projectStatus;
+	}
+
+	public String getAcceptTime() {
+		return acceptTime;
+	}
+
+	public void setAcceptTime(String acceptTime) {
+		this.acceptTime = acceptTime;
+	}
+
+	public String getReviewTime() {
+		return reviewTime;
+	}
+
+	public void setReviewTime(String reviewTime) {
+		this.reviewTime = reviewTime;
+	}
+
+	public String getPublicityTime() {
+		return publicityTime;
+	}
+
+	public void setPublicityTime(String publicityTime) {
+		this.publicityTime = publicityTime;
+	}
+
+	public String getLicenceTime() {
+		return licenceTime;
+	}
+
+	public void setLicenceTime(String licenceTime) {
+		this.licenceTime = licenceTime;
+	}
+
+	public Integer getMain() {
+		return main;
+	}
+
+	public void setMain(Integer main) {
+		this.main = main;
+	}
+
+	public Integer getLiquidationStatus() {
+		return liquidationStatus;
+	}
+
+	public void setLiquidationStatus(Integer liquidationStatus) {
+		this.liquidationStatus = liquidationStatus;
+	}
+
+	public String getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getSalesName() {
+		return salesName;
+	}
+
+	public void setSalesName(String salesName) {
+		this.salesName = salesName;
+	}
+
+	public String getDepartmentId() {
+		return departmentId;
+	}
+
+	public void setDepartmentId(String departmentId) {
+		this.departmentId = departmentId;
+	}
+
+	public String getSignTime() {
+		return signTime;
+	}
+
+	public void setSignTime(String signTime) {
+		this.signTime = signTime;
+	}
+
+	public String getBuyId() {
+		return buyId;
+	}
+
+	public void setBuyId(String buyId) {
+		this.buyId = buyId;
+	}
+
+	public String getSaleId() {
+		return saleId;
+	}
+
+	public void setSaleId(String saleId) {
+		this.saleId = saleId;
+	}
+
+	public String getBuyName() {
+		return buyName;
+	}
+
+	public void setBuyName(String buyName) {
+		this.buyName = buyName;
+	}
+
+	public BigDecimal getTotalAmount() {
+		return totalAmount;
+	}
+
+	public void setTotalAmount(BigDecimal totalAmount) {
+		this.totalAmount = totalAmount;
+	}
+
+	public BigDecimal getFirstAmount() {
+		return firstAmount;
+	}
+
+	public void setFirstAmount(BigDecimal firstAmount) {
+		this.firstAmount = firstAmount;
+	}
+
+	public BigDecimal getSettlementAmount() {
+		return settlementAmount;
+	}
+
+	public void setSettlementAmount(BigDecimal settlementAmount) {
+		this.settlementAmount = settlementAmount;
+	}
+
+	public BigDecimal getRefundAmount() {
+		return refundAmount;
+	}
+
+	public void setRefundAmount(BigDecimal refundAmount) {
+		this.refundAmount = refundAmount;
+	}
+
+	public Integer getOrderStatus() {
+		return orderStatus;
+	}
+
+	public void setOrderStatus(Integer orderStatus) {
+		this.orderStatus = orderStatus;
+	}
+
+	public Float getProofCount() {
+		return proofCount;
+	}
+
+	public void setProofCount(Float proofCount) {
+		this.proofCount = proofCount;
+	}
+
+	public String getDepartmentName() {
+		return departmentName;
+	}
+
+	public void setDepartmentName(String departmentName) {
+		this.departmentName = departmentName;
+	}
+
+	public String getKejim() {
+		return kejim;
+	}
+
+	public void setKejim(String kejim) {
+		this.kejim = kejim;
+	}
+
+	public String getRenzm() {
+		return renzm;
+	}
+
+	public void setRenzm(String renzm) {
+		this.renzm = renzm;
+	}
+
+	public String getKejiy() {
+		return kejiy;
+	}
+
+	public void setKejiy(String kejiy) {
+		this.kejiy = kejiy;
+	}
+
+	public String getRenzy() {
+		return renzy;
+	}
+
+	public void setRenzy(String renzy) {
+		this.renzy = renzy;
+	}
+
+	public Integer getProofStatus() {
+		return proofStatus;
+	}
+
+	public void setProofStatus(Integer proofStatus) {
+		this.proofStatus = proofStatus;
+	}
+
+	public String getStartTime1() {
+		return startTime1;
+	}
+
+	public void setStartTime1(String startTime1) {
+		this.startTime1 = startTime1;
+	}
+
+	public String getEndTime1() {
+		return endTime1;
+	}
+
+	public void setEndTime1(String endTime1) {
+		this.endTime1 = endTime1;
+	}
+	
+}

+ 375 - 375
src/main/java/com/goafanti/order/controller/OrderBonusStatisticsApiController.java

@@ -1,375 +1,375 @@
-package com.goafanti.order.controller;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Set;
-import java.util.TreeSet;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-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.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.common.bo.Error;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.common.model.TOrderMonthReport;
-import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.utils.ExcelUtils;
-import com.goafanti.common.utils.ExportExcelUtil;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.order.bo.OrderReportBo;
-import com.goafanti.order.bo.TOrderBonusBo;
-import com.goafanti.order.service.FundManageOrderService;
-import com.goafanti.order.service.OrderBonusService;
-import com.goafanti.order.service.OrderReportService;
-import com.goafanti.permission.service.NewRoleService;
-
-@RestController
-@RequestMapping(value = "/api/admin/bonus")
-public class OrderBonusStatisticsApiController extends CertifyApiController {
-	@Resource
-	private FundManageOrderService fundManageOrderServiceImpl;
-	@Resource
-	private OrderBonusService orderBonusServiceImpl;
-	@Resource
-	private OrderReportService orderReportServiceImpl;
-	@Resource
-	private NewRoleService newRoleService;
-	@Value(value = "${upload.private.path}")
-	private String	uploadPrivatePath	= null;
-	 /**
-	  * 财务专员校对单量
-	  * @param orderNew
-	  * @return
-	  */
-	 @RequestMapping(value="/proofreading", method = RequestMethod.POST)
-	 public Result proofreading(TOrderNew orderNew){
-		 Result res = new Result();
-		 res.setData(fundManageOrderServiceImpl.updateProofreading(orderNew));
-		 return res;
-	 }
-	 
-	 /**
-	  * 营销员奖金统计
-	  * @param orderNewBo
-	  * @return
-	  */
-	 @RequestMapping(value="/saleBonusStatistics", method = RequestMethod.GET)
-	 public Result saleBonusStatistics(TOrderBonusBo bonusBo, Integer pageNo, Integer pageSize){
-		 Result res = new Result();
-		 bonusBo.setGrantBy(TokenManager.getAdminId());
-		 res.setData(orderBonusServiceImpl.saleBonusStatistics(bonusBo, pageNo, pageSize));
-		 return res;
-	 }
-	 
-	 /**
-	  * 财务专员发放营销员奖金
-	  * @param id
-	  * @return
-	  */
-	 @RequestMapping(value="/bonusPayment", method = RequestMethod.POST)
-	 public Result bonusPayment(String id,String orderNo){
-		 Result res = new Result();
-		 Integer i = orderBonusServiceImpl.updateBounsPaymnetStatus(id, orderNo);
-		 if(i>0){
-				res.setData("发放成功!");
-			}else{
-				res.getError().add(buildError("", "没有校对单量,不能发放"));
-			}
-		 return res;
-	 }
-	 
-	 /**
-	  * 财务专员查看技术员奖金数据
-	  * @param bonusBo
-	  * @param pageNo
-	  * @param pageSize
-	  * @return
-	  */
-	 @RequestMapping(value="/technicianBonusStatistics", method = RequestMethod.GET)
-	 public Result technicianBonusStatistics(TOrderBonusBo bonusBo,Integer pageNo, Integer pageSize){
-		 Result res = new Result();
-		 bonusBo.setGrantBy(TokenManager.getAdminId());
-		 res.setData(orderBonusServiceImpl.technicianBonusStatistics(bonusBo, pageNo, pageSize));
-		 return res;
-	 }
-	 
-	 /**
-	  * 财务专员发放技术员的奖金操作
-	  * @param id
-	  * @return
-	  */
-	 @RequestMapping(value="/changeBonus", method = RequestMethod.POST)
-	 public Result changeBonus(String id){
-		 Result res = new Result();
-		 res.setData(orderBonusServiceImpl.updateChangeBonus(id));
-		 return res;
-	 }
-	 
-	 
-	 /**
-	  * 财务专员导出营销员奖金数据
-	  * @param bonusBo
-	  * @param response
-	  * @return
-	  * @throws IOException
-	  */
-	 @RequestMapping(value="/exportSaleBonusData", method = RequestMethod.GET)
-	 public Result exportSaleBonusData(TOrderBonusBo bonusBo,HttpServletResponse response) throws IOException{
-		 OutputStream out = response.getOutputStream();
-		 Result res = new Result();
-		 bonusBo.setGrantBy(TokenManager.getAdminId());
-		 XSSFWorkbook wb = orderBonusServiceImpl.exportSaleBonusData(bonusBo);
-		 if(null == wb){
-			 wb = new XSSFWorkbook();
-			 XSSFSheet sheet = wb.createSheet("没有营销员奖金记录");
-			 XSSFRow row = sheet.createRow(0);
-			 XSSFCell cell = row.createCell(0);
-			 cell.setCellValue("没有营销员奖金记录");
-		 }
-		 String fileName = "营销员奖金统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-		 response.setContentType("application/octet-stream;charset=utf-8");  
-		 try {
-			 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		 } finally {
-			 out.flush(); 
-			 out.close(); 
-		 }
-		 return res;
-	 }
-	 
-	/**
-	 * 导出技术员(咨询师)的奖金数据
-	 * @param bonusBo
-	 * @param response
-	 * @return
-	 * @throws IOException
-	 */
-	 @RequestMapping(value="/exportTechnicianBonusData", method = RequestMethod.GET)
-	 public Result exportTechnicianBonusData(TOrderBonusBo bonusBo,HttpServletResponse response) throws IOException{
-		 OutputStream out = response.getOutputStream();
-		 Result res = new Result();
-		 bonusBo.setGrantBy(TokenManager.getAdminId());
-		 XSSFWorkbook wb = orderBonusServiceImpl.exportTechnicianBonusData(bonusBo);
-		 if(null == wb){
-			 wb = new XSSFWorkbook();
-			 XSSFSheet sheet = wb.createSheet("没有技术员奖金记录");
-			 XSSFRow row = sheet.createRow(0);
-			 XSSFCell cell = row.createCell(0);
-			 cell.setCellValue("没有技术员奖金记录");
-		 }
-		 String fileName = "技术员奖金统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-		 response.setContentType("application/octet-stream;charset=utf-8");  
-		 try {
-			 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		 } finally {
-			 out.flush(); 
-			 out.close(); 
-		 }
-		 return res;
-	 }
-	 
-	 /**
-	  * 订单报表统计数据
-	  * @param reportBo
-	  * @param pageNo
-	  * @param pageSize
-	  * @return
-	  * @throws IOException
-	  */
-	 @RequestMapping(value="/orderReportList", method = RequestMethod.GET)
-	 public Result orderReportList(OrderReportBo reportBo, Integer pageNo, Integer pageSize) throws IOException{
-		Result res = new Result();
-		if(null == reportBo.getMonth() || null == reportBo.getMonth1()){
-			res.getError().add(buildError("", "没有指定订单日期"));
-			return res;
-		}
-		res.setData(orderReportServiceImpl.getOrderReportData(reportBo, pageNo, pageSize));
-		return res;
-	 }
-	 
-	 /**
-	  * 导出订单数据
-	  * @param orderReportBo
-	  * @param response
-	  * @return
-	  * @throws IOException
-	  */
-	 @RequestMapping(value="/exportOrderData", method = RequestMethod.GET)
-	 public Result exportOrderData(OrderReportBo orderReportBo,HttpServletResponse response) throws IOException{
-		 //判断当前登录的角色
-		 Result res = new Result();
-		 if(null == orderReportBo.getMonth() || null == orderReportBo.getMonth1()){
-			res.getError().add(buildError("", "没有指定订单日期"));
-			return res;
-		 }
-		 String date = orderReportBo.getMonth() == orderReportBo.getMonth1() ? orderReportBo.getMonth().toString() : orderReportBo.getMonth() + "-" + orderReportBo.getMonth1(); 
-		 OutputStream out = response.getOutputStream();
-		 XSSFWorkbook wb = orderReportServiceImpl.exportMonthData(orderReportBo, date);
-		 if(null == wb){
-			 wb = new XSSFWorkbook();
-			 XSSFSheet sheet = wb.createSheet("没有订单统计记录");
-			 XSSFRow row = sheet.createRow(0);
-			 XSSFCell cell = row.createCell(0);
-			 cell.setCellValue("没有订单统计记录");
-		 }
-		 String fileName = "订单统计" + date + ".xls";
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-		 response.setContentType("application/octet-stream;charset=utf-8");  
-		 try {
-			 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		 } finally {
-			 out.flush(); 
-			 out.close(); 
-		 }
-		 return res;
-	 }
-	 /**
-	  * 导入订单模板
-	  * @param req
-	  * @return
-	  */
-	@RequestMapping(value = "/uploadOrderExcel",method = RequestMethod.POST)
-	public Result uploadExcel(HttpServletRequest req){
-		Result res = new Result();
-		String excelPath = handleFile(res, "/order_report_file/", true, req, "");
-		ExcelUtils utils = new ExcelUtils();
-			Set<OrderReportBo> boSet;
-			try {
-				boSet = utils.parseOrderExcel(uploadPrivatePath + excelPath);
-				String errorMessage = "";
-				//if(boSet.size()>100)	errorMessage += "导入数据不能超过一百条;";
-				errorMessage += utils.getVacantRows();
-				if(StringUtils.isNotBlank(errorMessage)) {
-					res.getError().add(new Error(errorMessage));
-					return res;
-				}
-				Set<Integer> existRows = new TreeSet<Integer>(); //数据库已存在
-				Set<Integer> filterRows = new TreeSet<Integer>(); //过滤提示
-				orderReportServiceImpl.checkOrderReport(boSet,existRows,filterRows);
-				if(existRows.size()>0){
-					errorMessage = StringUtils.join(existRows.toArray(),",")+ " 订单统计数据已存在;";
-					res.getError().add(new Error(errorMessage));
-					return res;
-				}
-				if(filterRows.size()>0){
-					errorMessage = StringUtils.join(filterRows.toArray(),",")+ " 行没有找到相关员工电话,已经被系统过滤;";
-					res.getError().add(new Error(errorMessage));
-					return res;
-				}
-				res.setData(orderReportServiceImpl.saveUploadData(boSet));
-			} catch (IOException e) {
-				e.printStackTrace();
-			}	
-		return res;
-	}
-	
-	/**
-	 * 下载年度订单数据模板
-	 * @param response
-	 * @return
-	 * @throws IOException
-	 */
-	@RequestMapping(value = "/downOrderModelExcel",method = RequestMethod.GET)
-	public Result downOrderModelExcel(HttpServletResponse response) throws IOException{
-		Result res = new Result();
-		 OutputStream out = response.getOutputStream();
-		 XSSFWorkbook wb = ExportExcelUtil.downOrderModelExcel();
-		 String fileName = "导入年度销售数据模板.xls";
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-		 response.setContentType("application/octet-stream;charset=utf-8");  
-		 try {
-			 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		 } finally {
-			 out.flush(); 
-			 out.close(); 
-		 }
-		return res;
-	}
-	 
-	/**
-	 * 手动更新校对单量
-	 * @param report
-	 * @return
-	 */
-	@RequestMapping(value="/updateProof", method = RequestMethod.POST)
-	public Result updateProof(TOrderMonthReport report){
-		Result res = new Result();
-		res.setData(orderReportServiceImpl.updateMonthDataById(report));
-		return res;
-	}
-	
-	/**
-	 * 营销管理员查看所有营销员奖金
-	 * @param bonusBo
-	 * @param pageNo
-	 * @param pageSize
-	 * @return
-	 */
-	@RequestMapping(value="/getAllSaleBonus", method = RequestMethod.GET)
-	public Result getAllSaleBonus(TOrderBonusBo bonusBo, Integer pageNo, Integer pageSize){
-		 Result res = new Result();
-		 res.setData(orderBonusServiceImpl.saleBonusStatistics(bonusBo, pageNo, pageSize));
-		 return res;
-	}
-	
-	/**
-	 * 营销管理员导出所有营销员奖金
-	 * @param bonusBo
-	 * @param response
-	 * @return
-	 * @throws IOException
-	 */
-	 @RequestMapping(value="/exportAllSaleBonusData", method = RequestMethod.GET)
-	 public Result exportAllSaleBonusData(TOrderBonusBo bonusBo,HttpServletResponse response) throws IOException{
-		 OutputStream out = response.getOutputStream();
-		 Result res = new Result();
-		 XSSFWorkbook wb = orderBonusServiceImpl.exportSaleBonusData(bonusBo);
-		 if(null == wb){
-			 wb = new XSSFWorkbook();
-			 XSSFSheet sheet = wb.createSheet("没有营销员奖金记录");
-			 XSSFRow row = sheet.createRow(0);
-			 XSSFCell cell = row.createCell(0);
-			 cell.setCellValue("没有营销员奖金记录");
-		 }
-		 String fileName = "营销员奖金统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-		 response.setContentType("application/octet-stream;charset=utf-8");  
-		 try {
-			 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		 } finally {
-			 out.flush(); 
-			 out.close(); 
-		 }
-		 return res;
-	 }
-}
+package com.goafanti.order.controller;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+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.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Error;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.TOrderMonthReport;
+import com.goafanti.common.model.TOrderNew;
+import com.goafanti.common.utils.ExcelUtils;
+import com.goafanti.common.utils.ExportExcelUtil;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.OrderReportBo;
+import com.goafanti.order.bo.TOrderBonusBo;
+import com.goafanti.order.service.FundManageOrderService;
+import com.goafanti.order.service.OrderBonusService;
+import com.goafanti.order.service.OrderReportService;
+import com.goafanti.permission.service.NewRoleService;
+
+@RestController
+@RequestMapping(value = "/api/admin/bonus")
+public class OrderBonusStatisticsApiController extends CertifyApiController {
+	@Resource
+	private FundManageOrderService fundManageOrderServiceImpl;
+	@Resource
+	private OrderBonusService orderBonusServiceImpl;
+	@Resource
+	private OrderReportService orderReportServiceImpl;
+	@Resource
+	private NewRoleService newRoleService;
+	@Value(value = "${upload.private.path}")
+	private String	uploadPrivatePath	= null;
+	 /**
+	  * 财务专员校对单量
+	  * @param orderNew
+	  * @return
+	  */
+	 @RequestMapping(value="/proofreading", method = RequestMethod.POST)
+	 public Result proofreading(TOrderNew orderNew){
+		 Result res = new Result();
+		 res.setData(fundManageOrderServiceImpl.updateProofreading(orderNew));
+		 return res;
+	 }
+	 
+	 /**
+	  * 营销员奖金统计
+	  * @param orderNewBo
+	  * @return
+	  */
+	 @RequestMapping(value="/saleBonusStatistics", method = RequestMethod.GET)
+	 public Result saleBonusStatistics(TOrderBonusBo bonusBo, Integer pageNo, Integer pageSize){
+		 Result res = new Result();
+		 bonusBo.setGrantBy(TokenManager.getAdminId());
+		 res.setData(orderBonusServiceImpl.saleBonusStatistics(bonusBo, pageNo, pageSize));
+		 return res;
+	 }
+	 
+	 /**
+	  * 财务专员发放营销员奖金
+	  * @param id
+	  * @return
+	  */
+	 @RequestMapping(value="/bonusPayment", method = RequestMethod.POST)
+	 public Result bonusPayment(String id,String orderNo){
+		 Result res = new Result();
+		 Integer i = orderBonusServiceImpl.updateBounsPaymnetStatus(id, orderNo);
+		 if(i>0){
+				res.setData("发放成功!");
+			}else{
+				res.getError().add(buildError("", "没有校对单量,不能发放"));
+			}
+		 return res;
+	 }
+	 
+	 /**
+	  * 财务专员查看技术员奖金数据
+	  * @param bonusBo
+	  * @param pageNo
+	  * @param pageSize
+	  * @return
+	  */
+	 @RequestMapping(value="/technicianBonusStatistics", method = RequestMethod.GET)
+	 public Result technicianBonusStatistics(TOrderBonusBo bonusBo,Integer pageNo, Integer pageSize){
+		 Result res = new Result();
+		 
+		 res.setData(orderBonusServiceImpl.technicianBonusStatistics(bonusBo, pageNo, pageSize));
+		 return res;
+	 }
+	 
+	 /**
+	  * 财务专员发放技术员的奖金操作
+	  * @param id
+	  * @return
+	  */
+	 @RequestMapping(value="/changeBonus", method = RequestMethod.POST)
+	 public Result changeBonus(String id){
+		 Result res = new Result();
+		 res.setData(orderBonusServiceImpl.updateChangeBonus(id));
+		 return res;
+	 }
+	 
+	 
+	 /**
+	  * 财务专员导出营销员奖金数据
+	  * @param bonusBo
+	  * @param response
+	  * @return
+	  * @throws IOException
+	  */
+	 @RequestMapping(value="/exportSaleBonusData", method = RequestMethod.GET)
+	 public Result exportSaleBonusData(TOrderBonusBo bonusBo,HttpServletResponse response) throws IOException{
+		 OutputStream out = response.getOutputStream();
+		 Result res = new Result();
+		 bonusBo.setGrantBy(TokenManager.getAdminId());
+		 XSSFWorkbook wb = orderBonusServiceImpl.exportSaleBonusData(bonusBo);
+		 if(null == wb){
+			 wb = new XSSFWorkbook();
+			 XSSFSheet sheet = wb.createSheet("没有营销员奖金记录");
+			 XSSFRow row = sheet.createRow(0);
+			 XSSFCell cell = row.createCell(0);
+			 cell.setCellValue("没有营销员奖金记录");
+		 }
+		 String fileName = "营销员奖金统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
+		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
+		 response.setContentType("application/octet-stream;charset=utf-8");  
+		 try {
+			 // 返回数据流
+			 wb.write(out); 
+			 out.flush();
+			 out.close();
+		 } finally {
+			 out.flush(); 
+			 out.close(); 
+		 }
+		 return res;
+	 }
+	 
+	/**
+	 * 导出技术员(咨询师)的奖金数据
+	 * @param bonusBo
+	 * @param response
+	 * @return
+	 * @throws IOException
+	 */
+	 @RequestMapping(value="/exportTechnicianBonusData", method = RequestMethod.GET)
+	 public Result exportTechnicianBonusData(TOrderBonusBo bonusBo,HttpServletResponse response) throws IOException{
+		 OutputStream out = response.getOutputStream();
+		 Result res = new Result();
+		 bonusBo.setGrantBy(TokenManager.getAdminId());
+		 XSSFWorkbook wb = orderBonusServiceImpl.exportTechnicianBonusData(bonusBo);
+		 if(null == wb){
+			 wb = new XSSFWorkbook();
+			 XSSFSheet sheet = wb.createSheet("没有技术员奖金记录");
+			 XSSFRow row = sheet.createRow(0);
+			 XSSFCell cell = row.createCell(0);
+			 cell.setCellValue("没有技术员奖金记录");
+		 }
+		 String fileName = "技术员奖金统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
+		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
+		 response.setContentType("application/octet-stream;charset=utf-8");  
+		 try {
+			 // 返回数据流
+			 wb.write(out); 
+			 out.flush();
+			 out.close();
+		 } finally {
+			 out.flush(); 
+			 out.close(); 
+		 }
+		 return res;
+	 }
+	 
+	 /**
+	  * 订单报表统计数据
+	  * @param reportBo
+	  * @param pageNo
+	  * @param pageSize
+	  * @return
+	  * @throws IOException
+	  */
+	 @RequestMapping(value="/orderReportList", method = RequestMethod.GET)
+	 public Result orderReportList(OrderReportBo reportBo, Integer pageNo, Integer pageSize) throws IOException{
+		Result res = new Result();
+		if(null == reportBo.getMonth() || null == reportBo.getMonth1()){
+			res.getError().add(buildError("", "没有指定订单日期"));
+			return res;
+		}
+		res.setData(orderReportServiceImpl.getOrderReportData(reportBo, pageNo, pageSize));
+		return res;
+	 }
+	 
+	 /**
+	  * 导出订单数据
+	  * @param orderReportBo
+	  * @param response
+	  * @return
+	  * @throws IOException
+	  */
+	 @RequestMapping(value="/exportOrderData", method = RequestMethod.GET)
+	 public Result exportOrderData(OrderReportBo orderReportBo,HttpServletResponse response) throws IOException{
+		 //判断当前登录的角色
+		 Result res = new Result();
+		 if(null == orderReportBo.getMonth() || null == orderReportBo.getMonth1()){
+			res.getError().add(buildError("", "没有指定订单日期"));
+			return res;
+		 }
+		 String date = orderReportBo.getMonth() == orderReportBo.getMonth1() ? orderReportBo.getMonth().toString() : orderReportBo.getMonth() + "-" + orderReportBo.getMonth1(); 
+		 OutputStream out = response.getOutputStream();
+		 XSSFWorkbook wb = orderReportServiceImpl.exportMonthData(orderReportBo, date);
+		 if(null == wb){
+			 wb = new XSSFWorkbook();
+			 XSSFSheet sheet = wb.createSheet("没有订单统计记录");
+			 XSSFRow row = sheet.createRow(0);
+			 XSSFCell cell = row.createCell(0);
+			 cell.setCellValue("没有订单统计记录");
+		 }
+		 String fileName = "订单统计" + date + ".xls";
+		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
+		 response.setContentType("application/octet-stream;charset=utf-8");  
+		 try {
+			 // 返回数据流
+			 wb.write(out); 
+			 out.flush();
+			 out.close();
+		 } finally {
+			 out.flush(); 
+			 out.close(); 
+		 }
+		 return res;
+	 }
+	 /**
+	  * 导入订单模板
+	  * @param req
+	  * @return
+	  */
+	@RequestMapping(value = "/uploadOrderExcel",method = RequestMethod.POST)
+	public Result uploadExcel(HttpServletRequest req){
+		Result res = new Result();
+		String excelPath = handleFile(res, "/order_report_file/", true, req, "");
+		ExcelUtils utils = new ExcelUtils();
+			Set<OrderReportBo> boSet;
+			try {
+				boSet = utils.parseOrderExcel(uploadPrivatePath + excelPath);
+				String errorMessage = "";
+				//if(boSet.size()>100)	errorMessage += "导入数据不能超过一百条;";
+				errorMessage += utils.getVacantRows();
+				if(StringUtils.isNotBlank(errorMessage)) {
+					res.getError().add(new Error(errorMessage));
+					return res;
+				}
+				Set<Integer> existRows = new TreeSet<Integer>(); //数据库已存在
+				Set<Integer> filterRows = new TreeSet<Integer>(); //过滤提示
+				orderReportServiceImpl.checkOrderReport(boSet,existRows,filterRows);
+				if(existRows.size()>0){
+					errorMessage = StringUtils.join(existRows.toArray(),",")+ " 订单统计数据已存在;";
+					res.getError().add(new Error(errorMessage));
+					return res;
+				}
+				if(filterRows.size()>0){
+					errorMessage = StringUtils.join(filterRows.toArray(),",")+ " 行没有找到相关员工电话,已经被系统过滤;";
+					res.getError().add(new Error(errorMessage));
+					return res;
+				}
+				res.setData(orderReportServiceImpl.saveUploadData(boSet));
+			} catch (IOException e) {
+				e.printStackTrace();
+			}	
+		return res;
+	}
+	
+	/**
+	 * 下载年度订单数据模板
+	 * @param response
+	 * @return
+	 * @throws IOException
+	 */
+	@RequestMapping(value = "/downOrderModelExcel",method = RequestMethod.GET)
+	public Result downOrderModelExcel(HttpServletResponse response) throws IOException{
+		Result res = new Result();
+		 OutputStream out = response.getOutputStream();
+		 XSSFWorkbook wb = ExportExcelUtil.downOrderModelExcel();
+		 String fileName = "导入年度销售数据模板.xls";
+		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
+		 response.setContentType("application/octet-stream;charset=utf-8");  
+		 try {
+			 // 返回数据流
+			 wb.write(out); 
+			 out.flush();
+			 out.close();
+		 } finally {
+			 out.flush(); 
+			 out.close(); 
+		 }
+		return res;
+	}
+	 
+	/**
+	 * 手动更新校对单量
+	 * @param report
+	 * @return
+	 */
+	@RequestMapping(value="/updateProof", method = RequestMethod.POST)
+	public Result updateProof(TOrderMonthReport report){
+		Result res = new Result();
+		res.setData(orderReportServiceImpl.updateMonthDataById(report));
+		return res;
+	}
+	
+	/**
+	 * 营销管理员查看所有营销员奖金
+	 * @param bonusBo
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value="/getAllSaleBonus", method = RequestMethod.GET)
+	public Result getAllSaleBonus(TOrderBonusBo bonusBo, Integer pageNo, Integer pageSize){
+		 Result res = new Result();
+		 res.setData(orderBonusServiceImpl.saleBonusStatistics(bonusBo, pageNo, pageSize));
+		 return res;
+	}
+	
+	/**
+	 * 营销管理员导出所有营销员奖金
+	 * @param bonusBo
+	 * @param response
+	 * @return
+	 * @throws IOException
+	 */
+	 @RequestMapping(value="/exportAllSaleBonusData", method = RequestMethod.GET)
+	 public Result exportAllSaleBonusData(TOrderBonusBo bonusBo,HttpServletResponse response) throws IOException{
+		 OutputStream out = response.getOutputStream();
+		 Result res = new Result();
+		 XSSFWorkbook wb = orderBonusServiceImpl.exportSaleBonusData(bonusBo);
+		 if(null == wb){
+			 wb = new XSSFWorkbook();
+			 XSSFSheet sheet = wb.createSheet("没有营销员奖金记录");
+			 XSSFRow row = sheet.createRow(0);
+			 XSSFCell cell = row.createCell(0);
+			 cell.setCellValue("没有营销员奖金记录");
+		 }
+		 String fileName = "营销员奖金统计" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
+		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
+		 response.setContentType("application/octet-stream;charset=utf-8");  
+		 try {
+			 // 返回数据流
+			 wb.write(out); 
+			 out.flush();
+			 out.close();
+		 } finally {
+			 out.flush(); 
+			 out.close(); 
+		 }
+		 return res;
+	 }
+}

+ 203 - 188
src/main/java/com/goafanti/order/service/impl/OrderBonusServiceImpl.java

@@ -1,188 +1,203 @@
-package com.goafanti.order.service.impl;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.goafanti.common.dao.TOrderBonusMapper;
-import com.goafanti.common.dao.TOrderMonthReportMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.model.TOrderBonus;
-import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.utils.ExportExcelUtil;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.order.bo.OrderListBo;
-import com.goafanti.order.bo.OrderReportBo;
-import com.goafanti.order.bo.TOrderBonusBo;
-import com.goafanti.order.service.OrderBonusService;
-
-@Service
-public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> implements OrderBonusService {
-	
-	@Autowired
-	private TOrderBonusMapper bonusMapper;
-	@Autowired
-	private TOrderNewMapper orderNewMapper;
-	@Autowired
-	private TOrderMonthReportMapper orderMonthReportMapper;
-	
-	@Override
-	public Integer addOrderBouns(TOrderBonus bonus) {
-		// 生成id
-		bonus.setId(UUID.randomUUID().toString());
-		return bonusMapper.insertSelective(bonus);
-	}
-
-	@Override
-	public Integer updateBounsPaymnetStatus(String id,String orderNo) {
-		//先确定订单有没有校对信息
-		TOrderNew o = orderNewMapper.selectByPrimaryKey(orderNo);
-		if(null == o || StringUtils.isBlank(o.getProofAid())){//不存在或者没有校对
-			return -1;
-		}
-		TOrderBonus bonus = new TOrderBonus();
-		bonus.setId(id);
-		bonus.setGrantStatus(1);
-		//bonus.setGrantTime(new Date());发放时间预留
-		return bonusMapper.updateByPrimaryKeySelective(bonus);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<OrderListBo> technicianBonusStatistics(TOrderBonusBo newBo,Integer pageNo, Integer pageSize) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		params.put("b", newBo);
-		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("technicianBonusList", "technicianBonusCount", params, pageNo, pageSize);
-		return data;
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<TOrderBonusBo> saleBonusStatistics(TOrderBonusBo newBo, Integer pageNo, Integer pageSize) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		params.put("b", newBo);
-		Pagination<TOrderBonusBo> data = (Pagination<TOrderBonusBo>)findPage("saleBonusList", "saleBonusCount", params, pageNo, pageSize);
-		
-		innerData((List<TOrderBonusBo>) data.getList(), newBo);
-		return data;
-	}
-	
-	private void innerData(List<TOrderBonusBo> list, TOrderBonusBo newBo){
-		Integer m = null;
-		Integer m1 = null;
-		Integer y = null;
-		Integer y1 = null;
-		if(StringUtils.isNotEmpty(newBo.getStartTime()) && StringUtils.isNotEmpty(newBo.getEndTime())){
-			m = Integer.valueOf(newBo.getStartTime().replaceAll("-", ""));
-			m1 = Integer.valueOf(newBo.getEndTime().replaceAll("-", ""));
-			y = Integer.valueOf(newBo.getStartTime().substring(0, newBo.getStartTime().indexOf("-")));
-			y1 = Integer.valueOf(newBo.getEndTime().substring(0, newBo.getEndTime().indexOf("-")));
-		}else{
-			Calendar cal = Calendar.getInstance();
-			cal.setTime(new Date());
-			y = cal.get(Calendar.YEAR);
-			m = y*100 + (cal.get(Calendar.MONTH)+1);
-			y1 = y;
-			m1 = m;
-		}
-		for (TOrderBonusBo orderListBo : list) {
-			//处理月度数据
-			OrderReportBo r = new OrderReportBo();
-			r.setSalemansId(orderListBo.getGrantTarget());
-			r.setMonth(m);
-			r.setMonth1(m1);
-			List<OrderReportBo> l = orderMonthReportMapper.getMonthReportByMonth(r);
-			if(l.size() == 1){
-				OrderReportBo o = l.get(0);
-				if(null != o){
-					orderListBo.setKejim(o.getKejim());
-					orderListBo.setRenzm(o.getRenzm());
-				}
-			}
-			
-			r.setMonth(y);
-			r.setMonth1(y1);
-			//处理年度数据
-			List<OrderReportBo> ll = orderMonthReportMapper.getYearReportByYear(r);
-			if(l.size() == 1){
-				OrderReportBo o = ll.get(0);
-				if(null != o){
-					orderListBo.setKejiy(o.getKejiy());
-					orderListBo.setRenzy(o.getRenzy());
-				}
-			}
-		}
-	}
-
-	@Override
-	public Integer updateChangeBonus(String id) {
-		TOrderBonus bonus = new TOrderBonus();
-		bonus.setId(id);
-		bonus.setGrantStatus(1);
-		return bonusMapper.updateByPrimaryKeySelective(bonus);
-	}
-
-	@Override
-	public XSSFWorkbook exportTechnicianBonusData(TOrderBonusBo bonusBo) {
-		// 判断导出是否有部门
-		String deptid = bonusBo.getDepartmentId();
-		Map<String, List<TOrderBonusBo>> map = new HashMap<String, List<TOrderBonusBo>>();
-		if(StringUtils.isBlank(deptid)){
-			//获得所有有数据的部门
-			bonusBo.setGrantType(1);
-			List<TOrderBonusBo> dlist = bonusMapper.getDeptBySome(bonusBo);
-			if(null == dlist || dlist.size() == 0){
-				return null;
-			}
-			for (int i = 0; i < dlist.size(); i++) {
-				TOrderBonusBo ob = dlist.get(i);
-				if(null != ob && null!= ob.getDepartmentId()){
-					bonusBo.setDepartmentId(ob.getDepartmentId());
-					map.put(ob.getDepartmentName(), bonusMapper.getBonusData(bonusBo));
-				}
-			}
-		}else{
-			map.put(bonusBo.getDepartmentName(), bonusMapper.getBonusData(bonusBo));
-		}
-		String[] comment = {"任务编号","任务名称","订单编号","任务负责人","任务状态","任务数量","项目状态","受理日期","评审日期","下证日期","订单结算状态","发放类型","发放状态","奖金创建时间"};
-		XSSFWorkbook wb = ExportExcelUtil.exportDeptBonusInfoT(map, comment);
-		return wb;
-	}
-
-	@Override
-	public XSSFWorkbook exportSaleBonusData(TOrderBonusBo bonusBo) {
-		String deptid = bonusBo.getDepartmentId();
-		Map<String, List<TOrderBonusBo>> map = new HashMap<String, List<TOrderBonusBo>>();
-		if(StringUtils.isBlank(deptid)){
-			//获得所有有数据的部门
-			bonusBo.setGrantType(0);
-			List<TOrderBonusBo> dlist = bonusMapper.getDeptBySome(bonusBo);
-			if(null == dlist || dlist.size() == 0){
-				return null;
-			}
-			for (int i = 0; i < dlist.size(); i++) {
-				TOrderBonusBo ob = dlist.get(i);
-				bonusBo.setDepartmentId(ob.getDepartmentId());
-				List<TOrderBonusBo> l =  bonusMapper.getSaleBounsList(bonusBo);
-				innerData(l, bonusBo);
-				map.put(ob.getDepartmentName(), l);
-			}
-		}else{
-			List<TOrderBonusBo> l =  bonusMapper.getSaleBounsList(bonusBo);
-			innerData(l, bonusBo);
-			map.put(bonusBo.getDepartmentName(), l);
-		}
-		XSSFWorkbook wb = ExportExcelUtil.exportDeptBonusInfoS(map);
-		return wb;
-	}
-
-}
+package com.goafanti.order.service.impl;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.TOrderBonusMapper;
+import com.goafanti.common.dao.TOrderMonthReportMapper;
+import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.model.TOrderBonus;
+import com.goafanti.common.model.TOrderNew;
+import com.goafanti.common.utils.ExportExcelUtil;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.OrderListBo;
+import com.goafanti.order.bo.OrderReportBo;
+import com.goafanti.order.bo.TOrderBonusBo;
+import com.goafanti.order.service.OrderBonusService;
+
+@Service
+public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> implements OrderBonusService {
+	
+	@Autowired
+	private TOrderBonusMapper bonusMapper;
+	@Autowired
+	private TOrderNewMapper orderNewMapper;
+	@Autowired
+	private AdminMapper	adminMapper;
+	@Autowired
+	private TOrderMonthReportMapper orderMonthReportMapper;
+	
+	@Override
+	public Integer addOrderBouns(TOrderBonus bonus) {
+		// 生成id
+		bonus.setId(UUID.randomUUID().toString());
+		return bonusMapper.insertSelective(bonus);
+	}
+
+	@Override
+	public Integer updateBounsPaymnetStatus(String id,String orderNo) {
+		//先确定订单有没有校对信息
+		TOrderNew o = orderNewMapper.selectByPrimaryKey(orderNo);
+		if(null == o || StringUtils.isBlank(o.getProofAid())){//不存在或者没有校对
+			return -1;
+		}
+		TOrderBonus bonus = new TOrderBonus();
+		bonus.setId(id);
+		bonus.setGrantStatus(1);
+		//bonus.setGrantTime(new Date());发放时间预留
+		return bonusMapper.updateByPrimaryKeySelective(bonus);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderListBo> technicianBonusStatistics(TOrderBonusBo newBo,Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		List<String>fids= new ArrayList<>();
+		if (TokenManager.hasRole(AFTConstants.FINANCE)) {
+			fids.add(TokenManager.getAdminId());
+		}else if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
+			fids=adminMapper.selectBySuperId(TokenManager.getAdminId());
+		}
+		params.put("b", newBo);
+		params.put("fids", fids);
+		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("technicianBonusList", "technicianBonusCount", params, pageNo, pageSize);
+		return data;
+	}
+
+	
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderBonusBo> saleBonusStatistics(TOrderBonusBo newBo, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("b", newBo);
+		Pagination<TOrderBonusBo> data = (Pagination<TOrderBonusBo>)findPage("saleBonusList", "saleBonusCount", params, pageNo, pageSize);
+		
+		innerData((List<TOrderBonusBo>) data.getList(), newBo);
+		return data;
+	}
+	
+	private void innerData(List<TOrderBonusBo> list, TOrderBonusBo newBo){
+		Integer m = null;
+		Integer m1 = null;
+		Integer y = null;
+		Integer y1 = null;
+		if(StringUtils.isNotEmpty(newBo.getStartTime()) && StringUtils.isNotEmpty(newBo.getEndTime())){
+			m = Integer.valueOf(newBo.getStartTime().replaceAll("-", ""));
+			m1 = Integer.valueOf(newBo.getEndTime().replaceAll("-", ""));
+			y = Integer.valueOf(newBo.getStartTime().substring(0, newBo.getStartTime().indexOf("-")));
+			y1 = Integer.valueOf(newBo.getEndTime().substring(0, newBo.getEndTime().indexOf("-")));
+		}else{
+			Calendar cal = Calendar.getInstance();
+			cal.setTime(new Date());
+			y = cal.get(Calendar.YEAR);
+			m = y*100 + (cal.get(Calendar.MONTH)+1);
+			y1 = y;
+			m1 = m;
+		}
+		for (TOrderBonusBo orderListBo : list) {
+			//处理月度数据
+			OrderReportBo r = new OrderReportBo();
+			r.setSalemansId(orderListBo.getGrantTarget());
+			r.setMonth(m);
+			r.setMonth1(m1);
+			List<OrderReportBo> l = orderMonthReportMapper.getMonthReportByMonth(r);
+			if(l.size() == 1){
+				OrderReportBo o = l.get(0);
+				if(null != o){
+					orderListBo.setKejim(o.getKejim());
+					orderListBo.setRenzm(o.getRenzm());
+				}
+			}
+			
+			r.setMonth(y);
+			r.setMonth1(y1);
+			//处理年度数据
+			List<OrderReportBo> ll = orderMonthReportMapper.getYearReportByYear(r);
+			if(l.size() == 1){
+				OrderReportBo o = ll.get(0);
+				if(null != o){
+					orderListBo.setKejiy(o.getKejiy());
+					orderListBo.setRenzy(o.getRenzy());
+				}
+			}
+		}
+	}
+
+	@Override
+	public Integer updateChangeBonus(String id) {
+		TOrderBonus bonus = new TOrderBonus();
+		bonus.setId(id);
+		bonus.setGrantStatus(1);
+		return bonusMapper.updateByPrimaryKeySelective(bonus);
+	}
+
+	@Override
+	public XSSFWorkbook exportTechnicianBonusData(TOrderBonusBo bonusBo) {
+		// 判断导出是否有部门
+		String deptid = bonusBo.getDepartmentId();
+		Map<String, List<TOrderBonusBo>> map = new HashMap<String, List<TOrderBonusBo>>();
+		if(StringUtils.isBlank(deptid)){
+			//获得所有有数据的部门
+			bonusBo.setGrantType(1);
+			List<TOrderBonusBo> dlist = bonusMapper.getDeptBySome(bonusBo);
+			if(null == dlist || dlist.size() == 0){
+				return null;
+			}
+			for (int i = 0; i < dlist.size(); i++) {
+				TOrderBonusBo ob = dlist.get(i);
+				if(null != ob && null!= ob.getDepartmentId()){
+					bonusBo.setDepartmentId(ob.getDepartmentId());
+					map.put(ob.getDepartmentName(), bonusMapper.getBonusData(bonusBo));
+				}
+			}
+		}else{
+			map.put(bonusBo.getDepartmentName(), bonusMapper.getBonusData(bonusBo));
+		}
+		String[] comment = {"任务编号","任务名称","订单编号","任务负责人","任务状态","任务数量","项目状态","受理日期","评审日期","下证日期","订单结算状态","发放类型","发放状态","奖金创建时间"};
+		XSSFWorkbook wb = ExportExcelUtil.exportDeptBonusInfoT(map, comment);
+		return wb;
+	}
+
+	@Override
+	public XSSFWorkbook exportSaleBonusData(TOrderBonusBo bonusBo) {
+		String deptid = bonusBo.getDepartmentId();
+		Map<String, List<TOrderBonusBo>> map = new HashMap<String, List<TOrderBonusBo>>();
+		if(StringUtils.isBlank(deptid)){
+			//获得所有有数据的部门
+			bonusBo.setGrantType(0);
+			List<TOrderBonusBo> dlist = bonusMapper.getDeptBySome(bonusBo);
+			if(null == dlist || dlist.size() == 0){
+				return null;
+			}
+			for (int i = 0; i < dlist.size(); i++) {
+				TOrderBonusBo ob = dlist.get(i);
+				bonusBo.setDepartmentId(ob.getDepartmentId());
+				List<TOrderBonusBo> l =  bonusMapper.getSaleBounsList(bonusBo);
+				innerData(l, bonusBo);
+				map.put(ob.getDepartmentName(), l);
+			}
+		}else{
+			List<TOrderBonusBo> l =  bonusMapper.getSaleBounsList(bonusBo);
+			innerData(l, bonusBo);
+			map.put(bonusBo.getDepartmentName(), l);
+		}
+		XSSFWorkbook wb = ExportExcelUtil.exportDeptBonusInfoS(map);
+		return wb;
+	}
+
+}

+ 5 - 3
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -120,8 +120,6 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@Autowired
 	private OrderNewService	orderNewService;
 	@Autowired
-	private FundManageOrderService fundManageOrderService;
-	@Autowired
 	private NewOrderDunService	newOrderDunService;
 	@Autowired
 	private TChangeTaskMapper	TChangeTaskMapper;
@@ -483,7 +481,11 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		if (StringUtils.isNotBlank(endTime)) parameter.put("endTime", endTime+" 23:59:59");
 		if (StringUtils.isNotBlank(depId)) parameter.put("depId", depId);
 		if (StringUtils.isNotBlank(salesmanName)) parameter.put("salesmanName", salesmanName);
-		parameter.put("aid", TokenManager.getAdminId());
+		if(processState==5&&TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
+			parameter.put("aids", adminMapper.selectBySuperId(TokenManager.getAdminId()));
+		}else {
+			parameter.put("aid", TokenManager.getAdminId());
+		}
 		parameter.put("deps", orderService.selectMyDeps());
 		Pagination<NewOderCahngeListBo> data = (Pagination<NewOderCahngeListBo>)findPage("selectOrderChangeList", "selectOrderChangeCount", parameter, pageNo, pageSize);
 		return data;

+ 14 - 8
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -12,7 +12,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.OrganizationManagementMapper;
@@ -20,7 +19,6 @@ import com.goafanti.common.dao.TOrderInvoiceMapper;
 import com.goafanti.common.dao.TOrderMidMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.enums.NoticeStatus;
-import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.TOrderInvoice;
 import com.goafanti.common.model.TOrderNew;
@@ -31,7 +29,7 @@ import com.goafanti.order.bo.TOrderInvoiceBo;
 import com.goafanti.order.bo.TOrderInvoiceDetails;
 import com.goafanti.order.service.OrderInvoiceService;
 import com.goafanti.order.service.OrderNewService;
-import com.mysql.fabric.xmlrpc.base.Array;
+
 
 @Service
 public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper> implements OrderInvoiceService {
@@ -111,16 +109,24 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
-		if(type==0 &&(!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN))) {
+		List<String> aDep=new ArrayList<>();
+		//财务专员查看自己的
+		if (TokenManager.hasRole(AFTConstants.FINANCE)) {
 			params.put("financeId", TokenManager.getAdminId());
 		}
+		//财务经理
+		if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
+			aDep=adminMapper.selectDepIdWithSpuerId(TokenManager.getAdminId());
+			params.put("aDep", aDep);
+		}
 		if(StringUtils.isNotBlank(orderDep))params.put("orderDep", orderDep);
 		if(type!=null)params.put("type", type);
-		if (type ==1) {
-			//如果是省外则直接查本部门
+		//营销管理员
+		if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)) {
 			Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
-			params.put("aDep", a.getDepartmentId());
-		}
+			aDep.add(a.getDepartmentId());
+			params.put("aDep", aDep);
+		} 
 		if(StringUtils.isNotBlank(orderNo))params.put("orderNo", orderNo);
 		if(StringUtils.isNotBlank(name))params.put("name", name);
 		return (Pagination<TOrderInvoiceBo>)findPage("financeOrderInvoiceList", "financeOrderInvoiceCount", params, pageNo, pageSize);