TChangeDunOut.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.goafanti.order.bo;
  2. import java.math.BigDecimal;
  3. import java.util.Calendar;
  4. import com.goafanti.common.constant.AFTConstants;
  5. import com.goafanti.common.model.TChangeDun;
  6. import com.goafanti.common.utils.DateUtils;
  7. import com.goafanti.order.enums.NewOrderDunType;
  8. public class TChangeDunOut extends TChangeDun{
  9. private String dunTypeName;
  10. private String commodityName;
  11. private String startDate;
  12. private BigDecimal setUpAmount;
  13. public String getDunTypeName() {
  14. if(super.getDunType()!=null&&super.getProjectType()!=null&&super.getDunType()!=0) {
  15. return NewOrderDunType.getValueByCode(Integer.valueOf(""+super.getProjectType()+super.getDunType()));
  16. }
  17. if(super.getDunType()!=null&&super.getProjectType()!=null&&super.getDunType()==0) {
  18. return NewOrderDunType.getValueByCode(Integer.valueOf(""+super.getProjectType()+super.getDunType()))+getCustomizeName();
  19. }
  20. return dunTypeName;
  21. }
  22. public String getCommodityName() {
  23. return commodityName;
  24. }
  25. public void setCommodityName(String commodityName) {
  26. this.commodityName = commodityName;
  27. }
  28. public String getStartDate() {
  29. //会员显示到期时间
  30. if(super.getCreateTime()!=null&&super.getEffectiveCount()!=null) {
  31. Calendar calendar=Calendar.getInstance();
  32. calendar.setTime(super.getCreateTime());
  33. calendar.add(Calendar.DATE, super.getEffectiveCount()*180);
  34. return DateUtils.formatDate(calendar.getTime(), AFTConstants.YYYYMMDD);
  35. }
  36. //财税显示催款时间 大于9则年份+2,小于10年份+1
  37. if (super.getDunType()==2&&super.getProjectType()==5) {
  38. Calendar calendar=Calendar.getInstance();
  39. calendar.setTime(super.getCreateTime());
  40. int year = calendar.get(Calendar.YEAR);
  41. //获取月份,0表示1月份
  42. int month = calendar.get(Calendar.MONTH) + 1;
  43. if(month<10)year=year+1;
  44. if(month>9)year=year+2;
  45. calendar.set(year, 5, 1);
  46. return DateUtils.formatDate(calendar.getTime(), AFTConstants.YYYYMMDD);
  47. }
  48. return startDate;
  49. }
  50. public BigDecimal getMoney() {
  51. if(getDunType()!=null&&getProjectType()!=null){
  52. if(Integer.valueOf(""+getProjectType()+getDunType())==33&&
  53. super.getMoney()==null&&
  54. super.getAppropriationRatio()!=null&&getSetUpAmount()!=null) {
  55. return super.getAppropriationRatio().multiply(getSetUpAmount());
  56. }
  57. }
  58. return super.getMoney();
  59. }
  60. public BigDecimal getSetUpAmount() {
  61. return setUpAmount;
  62. }
  63. public void setSetUpAmount(BigDecimal setUpAmount) {
  64. this.setUpAmount = setUpAmount;
  65. }
  66. }