Browse Source

修改BUG提交

Signed-off-by: anderx <312518615@qq.com>
anderx 6 years ago
parent
commit
1ecc5cbfea

+ 13 - 0
src/main/java/com/goafanti/order/bo/OutNewOrderDunBo.java

@@ -42,12 +42,25 @@ public class OutNewOrderDunBo extends NewOrderDun {
 	}
 
 	public String getStartDate() {
+		//会员显示到期时间
 		if(super.getCreateTime()!=null&&super.getEffectiveCount()!=null) {
 			Calendar calendar=Calendar.getInstance();   
 	  		calendar.setTime(super.getCreateTime());
 	  		calendar.add(Calendar.DATE, super.getEffectiveCount()*180);
 	  		return DateUtils.formatDate(calendar.getTime(), AFTConstants.YYYYMMDD);
 		}
+		//财税显示催款时间 大于9则年份+2,小于10年份+1
+		if (super.getDunType()==2&&super.getProjectType()==5) {
+			Calendar calendar=Calendar.getInstance();   
+	  		calendar.setTime(super.getCreateTime());
+	  		int year = calendar.get(Calendar.YEAR);  
+		        //获取月份,0表示1月份
+		        int month = calendar.get(Calendar.MONTH) + 1;
+		        if(month<10)year=year+1;
+		        if(month>9)year=year+2;
+		        calendar.set(year, 5, 1);
+		        return DateUtils.formatDate(calendar.getTime(), AFTConstants.YYYYMMDD);
+		}
 		return startDate;
 	}
 

+ 3 - 2
src/main/java/com/goafanti/order/controller/AdminOrderReceivablesApiController.java

@@ -27,6 +27,7 @@ import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Attachment;
+import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.order.bo.OrderListBo;
 import com.goafanti.order.bo.ReceivablesListBo;
@@ -235,10 +236,10 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
      * @return
      */
     @RequestMapping(value = "/exportMyBill" , method = RequestMethod.GET)
-    public Result exportMyBill(HttpServletResponse response,String orderNo,Integer whoType,Integer pageSize ,Integer pageNo)  {
+    public Result exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer whoType,Integer pageSize ,Integer pageNo)  {
     	Result res=new Result();
 			try {
-				orderReceivablesService.exportMyBill( response, orderNo,whoType,pageSize,pageNo);
+				orderReceivablesService.exportMyBill( response, billNew,whoType,pageSize,pageNo);
 			} catch (Exception e) {
 				res.getError().add(buildError("格式不正确"));
 				e.printStackTrace();

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

@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.springframework.web.multipart.MultipartFile;
 
+import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.order.bo.OrderListBo;
 import com.goafanti.order.bo.ReceivablesListBo;
@@ -37,7 +38,7 @@ public interface OrderReceivablesService {
 
 	void exportInvoice(HttpServletResponse response, String orderNo, Integer pageSize, Integer pageNo)throws Exception;
 
-	void exportMyBill(HttpServletResponse response, String orderNo,Integer whoType, Integer pageSize, Integer pageNo)throws Exception;
+	void exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer whoType, Integer pageSize, Integer pageNo)throws Exception;
 
 
 }

+ 2 - 0
src/main/java/com/goafanti/order/service/impl/NewOrderDunServiceImpl.java

@@ -28,8 +28,10 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 		ib.setAid(TokenManager.getAdminId());
 		if (ib.getProjectType()==OrderDunProjectType.HY.getCode()&&ib.getDunType()==2&&ib.getEffectiveCount()>1) {
 			for (int i = 1; i <= ib.getEffectiveCount(); i++) {
+				int x=ib.getEffectiveCount();
 				ib.setEffectiveCount(i);
 				newOrderDunMapper.insertSelective(ib);
+				ib.setEffectiveCount(x);
 			}
 		}else {
 			newOrderDunMapper.insertSelective(ib);

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

@@ -360,7 +360,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 					orderNewService.addNewDunNoticAndSendEmail(tn,ob);
 					ob.setStatus(1);
 					ob.setStartTime(new Date());
-					newOrderDunMapper.updateByPrimaryKey(ob);
+					newOrderDunMapper.updateByPrimaryKeySelective(ob);
 				}
 			}
 		}

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

@@ -570,19 +570,17 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 		
 		@SuppressWarnings("unchecked")
 		@Override
-		public void exportMyBill(HttpServletResponse response, String orderNo,Integer whoType, Integer pageSize, Integer pageNo)throws Exception {
+		public void exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer whoType, Integer pageSize, Integer pageNo)throws Exception {
 
 			 OutputStream out = response.getOutputStream();
 				if(pageSize==null||pageSize<0)pageSize=9999;
 				if(pageNo==null||pageNo<0)pageNo=1;
-				TOrderBillNew billNew=new TOrderBillNew();
-				billNew.setOrderNo(orderNo);
+				
 				List<TOrderBillNew>list=(List<TOrderBillNew>) orderBillService.myBillList(billNew, whoType,pageNo, pageSize).getList();
 		    	try {
 		    		//设计表头
-		    		if(orderNo==null)orderNo="";
 		    		String[] comment = {"订单编号","合同编号","收款时间","财务流水时间","财务流水号","金额(万元)","收款方","付款方","流水科目","平台流水号","收款类型","备注"};
-		    		String fileName = orderNo+"流水记录列表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
+		    		String fileName = (billNew.getOrderNo()==null?"":billNew.getOrderNo())+"流水记录列表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
 		    		//type 0 收款 1开票 2流水
 		    		XSSFWorkbook wb =exportTemplateInfoS(comment,"流水记录",list,2);
 		    		//根据列表编写文档

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

@@ -1,13 +1,13 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-#jdbc.url=jdbc\:mysql\://localhost\:3306/aft?useUnicode\=true&characterEncoding\=UTF-8&autoReconnect\=true&useSSL\=false
-#jdbc.username=dev
-#jdbc.password=123456
+jdbc.url=jdbc\:mysql\://localhost\:3306/aft?useUnicode\=true&characterEncoding\=UTF-8&autoReconnect\=true&useSSL\=false
+jdbc.username=dev
+jdbc.password=123456
 #测试
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft_fz?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=aftdev
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft_fz?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570