Browse Source

1、科德业务管理系统的线上问题跟进处理及疑问解答。
2、科德业务管理系统订单中间表开发。
3、科德业务管理系统财务收款列表调整。
4、科德业务管理系统催款列表测试与修改。

Signed-off-by: anderx <312518615@qq.com>

anderx 6 years ago
parent
commit
5260f32402

+ 15 - 0
src/main/java/com/goafanti/business/bo/BusinessProjectBo.java

@@ -145,6 +145,9 @@ public class BusinessProjectBo {
 	 * 首付金额
 	 */
 	private BigDecimal firstPayment;
+	
+	
+	private Integer type;
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column business_project.max_logo
 	 * @return  the value of business_project.max_logo
@@ -642,4 +645,16 @@ public class BusinessProjectBo {
 	public void setFirstPayment(BigDecimal firstPayment) {
 		this.firstPayment = firstPayment;
 	}
+
+
+
+	public Integer getType() {
+		return type;
+	}
+
+
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/TOrderMidMapper.java

@@ -82,4 +82,6 @@ public interface TOrderMidMapper {
 	void updateFinanceId(@Param("id")String id, @Param("financeId")String financeId);
 
 	void updatefinalReceivables(@Param("orderNo")String orderNo,@Param("amount")BigDecimal amount, @Param("receivablesTime")Date receivablesTime);
+
+	void updateInvoice(String orderNo);
 }

+ 4 - 0
src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml

@@ -381,4 +381,8 @@
   update t_order_mid set final_receivables= #{amount},`final_Receivables_time`= #{receivablesTime}
 	where order_no= #{orderNo}
   </update>
+  <update id="updateInvoice">
+  update t_order_mid m,(select order_no,sum(amount)amount from t_order_invoice where status=2 group by order_no)b 
+	set m.invoice_amount=b.amount where m.order_no= #{orderNo} and  m.order_no=b.order_no 
+  </update>
 </mapper>

+ 20 - 19
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1080,16 +1080,14 @@
   <!-- 财务专员查看需要待收款的数据 -->
   <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
    select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,a.finance_name financeName,
-	o.process_status as processStatus, ifnull(b.amount, 0) as actuallyTotalAmount, o.contract_no as contractNo, o.approval, 
+	o.process_status as processStatus, o.settlement_amount as actuallyTotalAmount, o.contract_no as contractNo, o.approval, 
 	a.salesman_name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,too.amount outsourceAmount,
 	o.first_amount as signFirstPayment, o.total_amount as signTotalAmount, date_format(o.create_time, '%Y-%m-%d %H:%i:%s') as createTime,
-	e.name as outsourceName, 0 as companyId, d.name as departmentName, a.final_receivables finalReceivables ,
-	date_format(a.`final_Receivables_time`, '%Y-%m-%d %H:%i:%s')finalReceivablesTime, g.invoiceAmount from t_order_new o 
+	too.company_name as outsourceName, 0 as companyId, d.name as departmentName, a.final_receivables finalReceivables ,
+	date_format(a.`final_Receivables_time`, '%Y-%m-%d %H:%i:%s')finalReceivablesTime,a.invoice_amount invoiceAmount from t_order_new o 
 left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no 
-left join ( select sum(transaction_amount) as amount , order_no from t_order_bill_new group by order_no ) b 
-on b.order_no = o.order_no left join ( select order_no, max(name) as name from outsource_organization group by order_no) e on o.order_no = e.order_no
-left join t_order_outsource too on o.order_no=too.order_no left join ( select order_no , sum(amount) invoiceAmount from t_order_invoice where status = 2 group by order_no ) g on o.order_no = g.order_no
-where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}	
+left join t_order_outsource too on o.order_no=too.order_no where delete_sign != 1 and (approval = 0 or approval = 2) 
+	and outsource=  #{o.outsource,jdbcType=INTEGER}	
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1112,8 +1110,8 @@ where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.ou
 	  	and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
 	  	</if>
 	  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
-  	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
-  	</if>
+  		and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  		</if>
   		<if test="o.liquidationStatus != null">
 	  	and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1132,7 +1130,7 @@ where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.ou
 	  	<if test="o.startFinalReceivablesTime != null and o.startFinalReceivablesTime != &quot;&quot; and o.endFinalReceivablesTime != null and o.endFinalReceivablesTime != &quot;&quot;">
 	  	<bind name="c" value="o.startFinalReceivablesTime + ' 00:00:00'" />
 	  	<bind name="d" value="o.endFinalReceivablesTime + ' 23:59:59'" />
-	  	and f.create_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR}
+	  	and a.final_Receivables_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR}
 	  	</if>
 	  	order by o.liquidation_status, o.sign_time desc
 	  	<if test="page_sql != null">
@@ -1140,11 +1138,9 @@ where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.ou
 		</if>
   </select>
   <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
-  select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id  
-left join department d on o.order_dep = d.id   	left join (select x1.order_no,max(create_time) create_time,max(transaction_amount)transaction_amount from 
-(select x.order_no,x.create_time,x.transaction_amount from t_order_bill_new x right join (select order_no, max(create_time) maxTime from t_order_bill_new group by order_no)y
-	on  x.order_no=y.order_no and x.create_time=y.maxTime)x1 group by x1.order_no ) f on o.order_no = f.order_no
-  	 where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
+ select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id  
+left join department d on o.order_dep = d.id   left join t_order_mid a on o.order_no=a.order_no
+ where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1187,7 +1183,7 @@ left join department d on o.order_dep = d.id   	left join (select x1.order_no,ma
 	  	<if test="o.startFinalReceivablesTime != null and o.startFinalReceivablesTime != &quot;&quot; and o.endFinalReceivablesTime != null and o.endFinalReceivablesTime != &quot;&quot;">
 	  	<bind name="c" value="o.startFinalReceivablesTime + ' 00:00:00'" />
 	  	<bind name="d" value="o.endFinalReceivablesTime + ' 23:59:59'" />
-	  	and f.create_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR}
+	  	and a.final_Receivables_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR}
 	  	</if>
   </select>
   <!-- 通过订单编号获得订单的负责人(营销员) -->
@@ -1539,7 +1535,7 @@ where super_id is null ) e on e.order_no=a.order_no
   
   <select id="countTotalAndActually" parameterType="Map" resultType="java.util.Map">
 	   select sum(o.settlement_amount) actuallyTotalAmount,sum(o.total_amount) signTotalAmount from t_order_new o 
-  left join department d   on o.order_dep=d.id left join `user` u on o.buyer_id = u.id 
+  left join department d   on o.order_dep=d.id left join `user` u on o.buyer_id = u.id  left join t_order_mid a on o.order_no=a.order_no
   where o.delete_sign != 1  and (o.approval = 0 or o.approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
@@ -1577,9 +1573,14 @@ where super_id is null ) e on e.order_no=a.order_no
 	  	and u.nickname  like #{n,jdbcType=VARCHAR}
 	  	</if>
 	  	<if test="o.startTime != null and o.startTime != &quot;&quot; and o.endTime != null and o.endTime != &quot;&quot;">
-	  	<bind name="a" value="startTime + ' 00:00:00'" />
-	  	<bind name="b" value="endTime + ' 23:59:59'" />
+	  	<bind name="a" value="o.startTime + ' 00:00:00'" />
+	  	<bind name="b" value="o.endTime + ' 23:59:59'" />
 	  	and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
+	  	</if>
+	  	<if test="o.startFinalReceivablesTime != null and o.startFinalReceivablesTime != &quot;&quot; and o.endFinalReceivablesTime != null and o.endFinalReceivablesTime != &quot;&quot;">
+	  	<bind name="c" value="o.startFinalReceivablesTime + ' 00:00:00'" />
+	  	<bind name="d" value="o.endFinalReceivablesTime + ' 23:59:59'" />
+	  	and a.final_Receivables_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR}
 	  	</if>									
 	  	</select>	
 	  	

+ 1 - 1
src/main/java/com/goafanti/order/enums/NewOrderDunType.java

@@ -22,7 +22,7 @@ public enum NewOrderDunType {
 	RJKF_WZ(72,"软件开发-完成"),
 	ZSCQ_SQ(81,"知识产权-首期"),
 	ZSCQ_GS_SL_XZ(82,"知识产权-公示/专利受理/软著下证"),
-	ZSCQ_XZ(83,"知识产权-下证"),
+	ZSCQ_XZ(83,"知识产权-专利下证"),
 	INVALID(99,"未知");
 	
 	private NewOrderDunType(Integer code, String desc) {

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

@@ -33,11 +33,11 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 				newOrderDunMapper.insertSelective(ib);
 				ib.setEffectiveCount(x);
 			}
-		}else {
-			newOrderDunMapper.insertSelective(ib);
-		}
-		return 1;
+		}else 	newOrderDunMapper.insertSelective(ib);
+		return 0;
 	}
+	
+	
 	@Override
 	public int updateDun(InputNewOrderDunBo ib) {
 		return newOrderDunMapper.updateByPrimaryKeySelective(ib);

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

@@ -16,6 +16,7 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.OrganizationManagementMapper;
 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.model.Admin;
@@ -42,6 +43,8 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 	private AdminMapper	adminMapper;
 	@Autowired
 	private OrderNewService	orderNewService;
+	@Autowired
+	private TOrderMidMapper	tOrderMidMapper;
 	@Override
 	public int createServiceOrder(TOrderInvoice o) {
 		o.setCreateTime(new Date());
@@ -156,11 +159,20 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		}else if(examine==2) {
 			type=NoticeStatus.ORDER_INVPICE_END.getCode();
 			aids.add(o.getSalesmanId());
+			//重新计算开票金额
+			
 		}
 		orderNewService.pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
-		return tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
+		tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
+		if(examine==2)tOrderMidMapper.updateInvoice(t2.getOrderNo());
+		return 1; 
 	}
 
+		
+		
+
+
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name,String userName,

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

@@ -345,6 +345,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 						flag=true;
 					}else if (ob.getDunType()==2) {
 						BusinessProject bp=businessProjectMapper.selectByPrimaryKey(task2.getCommodityId());
+						if (bp.getType()==0&&t.getProjectStatus()==OrderProjectStatus.XMGS.getCode()) {
+							flag=true;
+						}
 						if (bp.getType()==1&&t.getProjectStatus()==OrderProjectStatus.XMYTJ.getCode()) {
 							flag=true;
 						}
@@ -354,7 +357,6 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 						
 					}
 				} 
-						
 					if(flag) {
 					TOrderNew tn=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
 					orderNewService.addNewDunNoticAndSendEmail(tn,ob);