Browse Source

客户入群修改成客户订单入群

anderx 1 year ago
parent
commit
0b559c5b5b

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

@@ -120,7 +120,6 @@ public interface TOrderMidMapper {
 
     void updateBidTypeByOrderNo(String orderNo);
 
-    void updateByPrimaryKeySelective(TOrderMid tm);
 
     void insertSelective(TOrderMid tm);
 

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

@@ -771,123 +771,7 @@
             x.actual_profit =z.settlement_amount-y.party
         where x.order_no =y.order_no and x.order_no=z.order_no
     </update>
-    <update id="updateByPrimaryKeySelective">
-        update t_order_mid
-        <set>
-            <if test="salesmanId != null">
-                salesman_id = #{salesmanId,jdbcType=VARCHAR},
-            </if>
-            <if test="financeId != null">
-                finance_id = #{financeId,jdbcType=VARCHAR},
-            </if>
-            <if test="salesmanName != null">
-                salesman_name = #{salesmanName,jdbcType=VARCHAR},
-            </if>
-            <if test="financeName != null">
-                finance_name = #{financeName,jdbcType=VARCHAR},
-            </if>
-            <if test="finalReceivables != null">
-                final_receivables = #{finalReceivables,jdbcType=DECIMAL},
-            </if>
-            <if test="finalReceivablesTime != null">
-                final_Receivables_time = #{finalReceivablesTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="invoiceAmount != null">
-                invoice_amount = #{invoiceAmount,jdbcType=DECIMAL},
-            </if>
-            <if test="createTime != null">
-                create_time = #{createTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="buyerName != null">
-                buyer_name = #{buyerName,jdbcType=VARCHAR},
-            </if>
-            <if test="orderReceivables != null">
-                order_receivables = #{orderReceivables,jdbcType=DECIMAL},
-            </if>
-            <if test="orderArrears != null">
-                order_arrears = #{orderArrears,jdbcType=DECIMAL},
-            </if>
-            <if test="paymentAmount != null">
-                payment_amount = #{paymentAmount,jdbcType=DECIMAL},
-            </if>
-            <if test="costAmount != null">
-                cost_amount = #{costAmount,jdbcType=DECIMAL},
-            </if>
-            <if test="depName != null">
-                dep_name = #{depName,jdbcType=VARCHAR},
-            </if>
-            <if test="provinceName != null">
-                province_name = #{provinceName,jdbcType=VARCHAR},
-            </if>
-            <if test="legalAffairs != null">
-                legal_affairs = #{legalAffairs,jdbcType=INTEGER},
-            </if>
-            <if test="dunStartTime != null">
-                dun_start_time = #{dunStartTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="legalAffairsType != null">
-                legal_affairs_type = #{legalAffairsType,jdbcType=INTEGER},
-            </if>
-            <if test="operationTime != null">
-                operation_time = #{operationTime,jdbcType=DATE},
-            </if>
-            <if test="legalAffairsStatus != null">
-                legal_affairs_status = #{legalAffairsStatus,jdbcType=INTEGER},
-            </if>
-            <if test="projectType != null">
-                project_type = #{projectType,jdbcType=INTEGER},
-            </if>
-            <if test="serviceType != null">
-                service_type = #{serviceType,jdbcType=VARCHAR},
-            </if>
-            <if test="serviceProject != null">
-                service_project = #{serviceProject,jdbcType=VARCHAR},
-            </if>
-            <if test="patentCost != null">
-                patent_cost = #{patentCost,jdbcType=DECIMAL},
-            </if>
-            <if test="patentCostActual != null">
-                patent_cost_actual = #{patentCostActual,jdbcType=DECIMAL},
-            </if>
-            <if test="softCost != null">
-                soft_cost = #{softCost,jdbcType=DECIMAL},
-            </if>
-            <if test="softCostActual != null">
-                soft_cost_actual = #{softCostActual,jdbcType=DECIMAL},
-            </if>
-            <if test="auditCost != null">
-                audit_cost = #{auditCost,jdbcType=DECIMAL},
-            </if>
-            <if test="auditCostActual != null">
-                audit_cost_actual = #{auditCostActual,jdbcType=DECIMAL},
-            </if>
-            <if test="otherCost != null">
-                other_cost = #{otherCost,jdbcType=DECIMAL},
-            </if>
-            <if test="otherCostActual != null">
-                other_cost_actual = #{otherCostActual,jdbcType=DECIMAL},
-            </if>
-            <if test="expectProfit != null">
-                expect_profit = #{expectProfit,jdbcType=DECIMAL},
-            </if>
-            <if test="actualProfit != null">
-                actual_profit = #{actualProfit,jdbcType=DECIMAL},
-            </if>
-            <if test="stopProject != null">
-                stop_project = #{stopProject,jdbcType=INTEGER},
-            </if>
-            <if test="stopProject != null">
-                stop_project = #{stopProject,jdbcType=INTEGER},
-            </if>
-            <if test="dunNodeContent != null">
-                dun_node_content = #{dunNodeContent},
-            </if>
-            <if test="expenseAmount != null">
-                expense_amount = #{expenseAmount},
-            </if>
-        </set>
-        where id = #{id}
-    </update>
+
 
     <update id="updateByOrderNo">
         update t_order_mid

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

@@ -6,10 +6,7 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AttachmentType;
-import com.goafanti.common.model.TOrderAssist;
-import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.model.TOrderNewWithBLOBs;
-import com.goafanti.common.model.TOrderRefundWithBLOBs;
+import com.goafanti.common.model.*;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
@@ -922,5 +919,21 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	}
 
 
+	/**
+	 * 修改用户是否入群
+	 * @param us
+	 * @return
+	 */
+	@RequestMapping(value = "/updateAddGroupChat",method = RequestMethod.POST)
+	public Result updateAddGroupChat(TOrderMid us) {
+		Result res =new Result();
+		if(us.getOrderNo()==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "订单编号"));
+		}
+		res.data(orderNewService.updateAddGroupChat(us));
+		return res;
+	}
+
+
 
 }

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

@@ -241,4 +241,6 @@ public interface OrderNewService {
 	void pushOrderDunContent(TOrderNew e);
 
 	String pushOrderGetDunContent(TOrderNew e);
+
+    Object updateAddGroupChat(TOrderMid us);
 }

+ 24 - 2
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -1007,7 +1007,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		tm.setExpectProfit(t.getTotalAmount());
 		tm.setDepName(tOrderMidMapper.selectDepNameByDepid(t.getOrderDep()));
 		if (tm.getId()!=null) {
-			tOrderMidMapper.updateByPrimaryKeySelective(tm);
+			tOrderMidMapper.update(tm);
 		}else {
 			tOrderMidMapper.insertSelective(tm);
 		}
@@ -1515,7 +1515,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (tm.getDunStartTime()==null) {
 			tm.setDunStartTime(date);
 		}
-		tOrderMidMapper.updateByPrimaryKeySelective(tm);
+		tOrderMidMapper.update(tm);
 		return tm;
 	}
 	@Override
@@ -2570,4 +2570,26 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		return valueByCode.toString();
 	}
 
+    @Override
+    public Object updateAddGroupChat(TOrderMid in) {
+		TOrderMid update =new TOrderMid();
+		TOrderMid tOrderMid = tOrderMidMapper.selectByOrderNo(in.getOrderNo());
+		Date date = new Date();
+		if (tOrderMid !=null){
+			update.setId(tOrderMid.getId());
+			update.setAddGroupChat(in.getAddGroupChat());
+			if (update.getAddGroupChat()==1){
+				update.setAddGroupChatTime(date);
+			}
+			tOrderMidMapper.update(update);
+		}else {
+			if (in.getAddGroupChat()==1){
+				in.setAddGroupChatTime(date);
+			}
+			tOrderMidMapper.insertSelective(in);
+
+		}
+		return 1;
+	}
+
 }

+ 5 - 18
src/main/java/com/goafanti/user/bo/InputUserServiceFollow.java

@@ -1,31 +1,18 @@
 package com.goafanti.user.bo;
 
-public class InputUserServiceFollow {
+import com.goafanti.common.model.UserServiceFollow;
 
+public class InputUserServiceFollow extends UserServiceFollow{
 
-	private String orderNo;
 	/**
-	 * 是否加群 0=否,1=是
+	 *
 	 */
-	private Integer addGroupChat;
-	
-	private String renewalTimes;
+	private static final long serialVersionUID = 1L;
 
-	public String getOrderNo() {
-		return orderNo;
-	}
 
-	public void setOrderNo(String orderNo) {
-		this.orderNo = orderNo;
-	}
 
-	public Integer getAddGroupChat() {
-		return addGroupChat;
-	}
+	private String renewalTimes;
 
-	public void setAddGroupChat(Integer addGroupChat) {
-		this.addGroupChat = addGroupChat;
-	}
 
 	public String getRenewalTimes() {
 		return renewalTimes;

+ 1 - 14
src/main/java/com/goafanti/user/controller/UserServiceApiController.java

@@ -38,20 +38,7 @@ public class UserServiceApiController extends BaseApiController {
 		return res;
 	}
 
-	/**
-	 * 修改用户是否入群
-	 * @param us
-	 * @return
-	 */
-	@RequestMapping(value = "/updateUseService",method = RequestMethod.POST)
-	public Result updateUseService(InputUserServiceFollow us) {
-		Result res =new Result();
-		if(us.getOrderNo()==null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "订单编号"));
-		}
-		res.data(userServiceService.updateUseService(us));
-		return res;
-	}
+
 
 
 	@RequestMapping(value = "/listUseServiceFollow",method = RequestMethod.GET)

+ 0 - 1
src/main/java/com/goafanti/user/service/UserServiceService.java

@@ -22,5 +22,4 @@ public interface UserServiceService {
 	List<OutOrderUserService> listOrderUseServiceGetList(InputListOrderUserService i);
 
 
-	int updateUseService(InputUserServiceFollow us);
 }

+ 4 - 20
src/main/java/com/goafanti/user/service/impl/UserServiceServiceImpl.java

@@ -2,6 +2,7 @@ package com.goafanti.user.service.impl;
 
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.TOrderMidMapper;
 import com.goafanti.common.dao.UserServiceFollowMapper;
 import com.goafanti.common.dao.UserServiceMapper;
 import com.goafanti.common.model.UserService;
@@ -30,6 +31,8 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 	private UserServiceFollowMapper userServiceFollowMapper;
 	@Resource
 	private DepartmentService departmentService;
+	@Resource
+	private TOrderMidMapper tOrderMidMapper;
 
 	@Override
 	public int addUseService(InputUserServiceFollow us) {
@@ -94,26 +97,7 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 		return list;
 	}
 
-	@Override
-	public int updateUseService(InputUserServiceFollow us) {
-		UserService update =new UserService();
-		Integer id=userServiceMapper.selectByUid(us.getUid());
-		update.setUid(us.getUid());
-		update.setAddGroupChat(us.getAddGroupChat());
-		Date date = new Date();
-		if (update.getAddGroupChat()==1){
-			update.setAddGroupChatTime(date);
-		}
-		if (id==null) {
-			update.setCreateTime(date);
-			update.setNewTime(date);
-			userServiceMapper.insertSelective(update);
-		}else {
-			update.setId(id);
-			userServiceMapper.update(update);
-		}
-		return 1;
-	}
+
 
 	private void setOrderUserService(List<OutOrderUserService> list) {
 		for (OutOrderUserService ou: list) {