| | |
| | | int deleteById(Object object); |
| | | |
| | | /*更新总订单 支付信息*/ |
| | | void updatePay(@Param("payRecharge")BigDecimal payRecharge,@Param("payIncrement") BigDecimal payIncrement, |
| | | void updatePay(@Param("actualTotal")BigDecimal actualTotal,@Param("payRecharge")BigDecimal payRecharge,@Param("payIncrement") BigDecimal payIncrement, |
| | | @Param("payTotal") BigDecimal payTotal,@Param("status") Integer status, @Param("id")String id,@Param("payTime") Date payTime, |
| | | @Param("payStatus") Integer payStatus); |
| | | } |
| | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,orderId = #{orderId},shopId = #{shopId},shopName = #{shopName},employeeId = #{employeeId},employeeName = #{employeeName},isDel = #{isDel},createTime = #{createTime} |
| | | ,orderId = #{orderId},shopId = #{shopId},shopName = #{shopName},employeeId = #{employeeId},employeeName = #{employeeName},type = #{type},isDel = #{isDel},createTime = #{createTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into orders_developer (id,orderId,shopId,shopName,employeeId,employeeName,isDel,createTime) values (#{id},#{orderId},#{shopId},#{shopName},#{employeeId},#{employeeName},#{isDel},#{createTime}) |
| | | insert into orders_developer (id,orderId,shopId,shopName,employeeId,employeeName,type,isDel,createTime) values (#{id},#{orderId},#{shopId},#{shopName},#{employeeId},#{employeeName},#{type},#{isDel},#{createTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phiappt.model.order.OrderDeveloper" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrderDeveloper" parameterType="java.lang.Object" > |
| | | select |
| | | id,orderId,shopId,shopName,employeeId,employeeName,isDel,createTime |
| | | id,orderId,shopId,shopName,employeeId,employeeName,type,isDel,createTime |
| | | from orders_developer |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrderDeveloper" parameterType="java.lang.Object" > |
| | | select |
| | | id,orderId,shopId,shopName,employeeId,employeeName,isDel,createTime |
| | | id,orderId,shopId,shopName,employeeId,employeeName,type,isDel,createTime |
| | | from orders_developer |
| | | WHERE id = #{value} |
| | | </select> |
| | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,orderNo = #{orderNo},type = #{type},status = #{status},payStatus = #{payStatus},payTime = #{payTime},refundStatus = #{refundStatus},cancelTime = #{cancelTime},total = #{total},shouldTotal = #{shouldTotal},actualTotal = #{actualTotal},payTotal = #{payTotal},payRecharge = #{payRecharge},payIncrement = #{payIncrement},discountTotal = #{discountTotal},shopId = #{shopId},shopName = #{shopName},operatorType = #{operatorType},operatorId = #{operatorId},operatorName = #{operatorName},developerShopId = #{developerShopId},developerShopName = #{developerShopName},appId = #{appId},sourceCode = #{sourceCode},sourceName = #{sourceName},sourceOrderNo = #{sourceOrderNo},conversionCode = #{conversionCode},channelType = #{channelType},commonId = #{commonId},commonName = #{commonName},departmentCode = #{departmentCode},departmentName = #{departmentName},hisSynStatus = #{hisSynStatus},hisOrderId = #{hisOrderId},remarks = #{remarks},userId = #{userId},isDel = #{isDel},createTime = #{createTime} |
| | | ,orderNo = #{orderNo},type = #{type},status = #{status},payStatus = #{payStatus},payTime = #{payTime},refundStatus = #{refundStatus},cancelTime = #{cancelTime},total = #{total},shouldTotal = #{shouldTotal},actualTotal = #{actualTotal},payTotal = #{payTotal},payRecharge = #{payRecharge},payIncrement = #{payIncrement},discountTotal = #{discountTotal},shopId = #{shopId},shopName = #{shopName},operatorType = #{operatorType},operatorId = #{operatorId},operatorName = #{operatorName},developerShopId = #{developerShopId},developerShopName = #{developerShopName},developerId = #{developerId},developerName = #{developerName},appId = #{appId},sourceCode = #{sourceCode},sourceName = #{sourceName},sourceOrderNo = #{sourceOrderNo},conversionCode = #{conversionCode},channelType = #{channelType},commonId = #{commonId},commonName = #{commonName},departmentCode = #{departmentCode},departmentName = #{departmentName},hisSynStatus = #{hisSynStatus},hisOrderId = #{hisOrderId},remarks = #{remarks},userId = #{userId},isDel = #{isDel},createTime = #{createTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into orders_total (id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime) values (#{id},#{orderNo},#{type},#{status},#{payStatus},#{payTime},#{refundStatus},#{cancelTime},#{total},#{shouldTotal},#{actualTotal},#{payTotal},#{payRecharge},#{payIncrement},#{discountTotal},#{shopId},#{shopName},#{operatorType},#{operatorId},#{operatorName},#{developerShopId},#{developerShopName},#{appId},#{sourceCode},#{sourceName},#{sourceOrderNo},#{conversionCode},#{channelType},#{commonId},#{commonName},#{departmentCode},#{departmentName},#{hisSynStatus},#{hisOrderId},#{remarks},#{userId},#{isDel},#{createTime}) |
| | | insert into orders_total (id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,developerId,developerName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime) values (#{id},#{orderNo},#{type},#{status},#{payStatus},#{payTime},#{refundStatus},#{cancelTime},#{total},#{shouldTotal},#{actualTotal},#{payTotal},#{payRecharge},#{payIncrement},#{discountTotal},#{shopId},#{shopName},#{operatorType},#{operatorId},#{operatorName},#{developerShopId},#{developerShopName},#{developerId},#{developerName},#{appId},#{sourceCode},#{sourceName},#{sourceOrderNo},#{conversionCode},#{channelType},#{commonId},#{commonName},#{departmentCode},#{departmentName},#{hisSynStatus},#{hisOrderId},#{remarks},#{userId},#{isDel},#{createTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByUserProjectId" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="java.lang.Object" > |
| | | SELECT ot.* FROM `user_project_item` AS upi |
| | | INNER JOIN order_item AS oi ON oi.id=upi.orderItemId |
| | | INNER JOIN orders_total AS ot ON ot.id=oi.orderId WHERE ot.isDel=0 AND upi.userProjectId=#{value} LIMIT 1; |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="java.lang.Object" > |
| | | select |
| | | id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime |
| | | id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,developerId,developerName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime |
| | | from orders_total |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.order.OrdersTotal" parameterType="java.lang.Object" > |
| | | select |
| | | id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime |
| | | id,orderNo,type,status,payStatus,payTime,refundStatus,cancelTime,total,shouldTotal,actualTotal,payTotal,payRecharge,payIncrement,discountTotal,shopId,shopName,operatorType,operatorId,operatorName,developerShopId,developerShopName,developerId,developerName,appId,sourceCode,sourceName,sourceOrderNo,conversionCode,channelType,commonId,commonName,departmentCode,departmentName,hisSynStatus,hisOrderId,remarks,userId,isDel,createTime |
| | | from orders_total |
| | | WHERE id = #{value} |
| | | </select> |
| | |
| | | delete from orders_total WHERE id = #{value} |
| | | </delete> |
| | | |
| | | |
| | | <select id="selectOneByUserProjectId" parameterType="java.lang.Object" resultType="com.hx.phiappt.model.order.OrdersTotal"> |
| | | SELECT ot.* FROM `user_project_item` AS upi |
| | | INNER JOIN order_item AS oi ON oi.id=upi.orderItemId |
| | | INNER JOIN orders_total AS ot ON ot.id=oi.orderId WHERE ot.isDel=0 AND upi.userProjectId=#{value} LIMIT 1; |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <update id="updatePay"> |
| | | update |
| | | orders_total |
| | | SET payTotal=#{payTotal},payRecharge=#{payRecharge},payIncrement=#{payIncrement},status=#{status},payStatus=#{payStatus},payTime=#{payTime} |
| | | SET actualTotal=#{actualTotal},payTotal=#{payTotal},payRecharge=#{payRecharge},payIncrement=#{payIncrement},status=#{status},payStatus=#{payStatus},payTime=#{payTime} |
| | | where id =#{id} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | package com.hx.phip.order.service; |
| | | |
| | | import com.hx.phiappt.model.order.OrderDeveloper; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface OrderDeveloperService { |
| | | |
| | | int selectCount(SqlSentence sqlSentence); |
| | | |
| | | void insert(OrderDeveloper orderDeveloper); |
| | | |
| | | List<OrderDeveloper> selectList(SqlSentence sqlSentence); |
| | | |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | |
| | | OrderDeveloper selectOne(SqlSentence sqlSentence); |
| | | |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | |
| | | OrderDeveloper selectOneByKey(Object object); |
| | | |
| | | OrderDeveloper selectOneByKeyBlob(Object object); |
| | | |
| | | void updateAll(OrderDeveloper orderDeveloper); |
| | | |
| | | void updateWhere(SqlSentence sqlSentence); |
| | | |
| | | void deleteOne(String delId); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.order.service.impl; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.phip.dao.mapper.OrderDeveloperMapper; |
| | | import com.hx.phiappt.model.order.OrderDeveloper; |
| | | import com.hx.phip.order.service.OrderDeveloperService; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Transactional |
| | | @Service |
| | | public class OrderDeveloperServiceImpl implements OrderDeveloperService { |
| | | |
| | | @Resource |
| | | private OrderDeveloperMapper orderDeveloperMapper; |
| | | |
| | | /**查询列表*/ |
| | | @Override |
| | | public List<OrderDeveloper> selectList(SqlSentence sqlSentence) { |
| | | return orderDeveloperMapper.selectList(sqlSentence); |
| | | } |
| | | |
| | | /**查询列表*/ |
| | | @Override |
| | | public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) { |
| | | return orderDeveloperMapper.selectListMap(sqlSentence); |
| | | } |
| | | |
| | | /**查询单个*/ |
| | | @Override |
| | | public OrderDeveloper selectOne(SqlSentence sqlSentence) { |
| | | return orderDeveloperMapper.selectOne(sqlSentence); |
| | | } |
| | | |
| | | /**查询单个*/ |
| | | @Override |
| | | public Map<String,Object> selectOneMap(SqlSentence sqlSentence) { |
| | | return orderDeveloperMapper.selectOneMap(sqlSentence); |
| | | } |
| | | |
| | | /**查询单个,大数据不拿取*/ |
| | | @Override |
| | | public OrderDeveloper selectOneByKey(Object object) { |
| | | return orderDeveloperMapper.selectOneByKey(object); |
| | | } |
| | | |
| | | /**查询单个,大数据拿取*/ |
| | | @Override |
| | | public OrderDeveloper selectOneByKeyBlob(Object object) { |
| | | return orderDeveloperMapper.selectOneByKeyBlob(object); |
| | | } |
| | | |
| | | /**新增*/ |
| | | @Override |
| | | public void insert(OrderDeveloper orderDeveloper) { |
| | | int count = orderDeveloperMapper.insert(orderDeveloper); |
| | | if(count != 1) { |
| | | throw new TipsException("新增失败!"); |
| | | } |
| | | } |
| | | |
| | | /**修改*/ |
| | | @Override |
| | | public void updateAll(OrderDeveloper orderDeveloper) { |
| | | int count = orderDeveloperMapper.updateAll(orderDeveloper); |
| | | if(count!=1) { |
| | | throw new TipsException("保存失败!"); |
| | | } |
| | | } |
| | | |
| | | /**修改*/ |
| | | @Override |
| | | public void updateWhere(SqlSentence sqlSentence) { |
| | | int count = orderDeveloperMapper.updateWhere(sqlSentence); |
| | | if(count!=1) { |
| | | throw new TipsException("保存失败!"); |
| | | } |
| | | } |
| | | |
| | | /**删除一个*/ |
| | | @Override |
| | | public void deleteOne(String delId) { |
| | | int count = orderDeveloperMapper.deleteById(delId); |
| | | if(count!=1) { |
| | | throw new TipsException("删除失败!"); |
| | | } |
| | | } |
| | | |
| | | /**查询条数*/ |
| | | @Override |
| | | public int selectCount(SqlSentence sqlSentence) { |
| | | int count = orderDeveloperMapper.selectCount(sqlSentence); |
| | | return count; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //如果开发人集合为空,那么默认用户的所属顾问 |
| | | if(orderDeveloperList==null || orderDeveloperList.size()==0){ |
| | | // if(orderDeveloperList==null || orderDeveloperList.size()==0){ |
| | | User user = userService.selectOneByKey(ordersTotal.getUserId()); |
| | | if(StringUtils.noNull(user.getHisCorpUserId())){ |
| | | Shop userShop = shopService.selectAdiver(user.getHisCorpUserId()); |
| | | Employee userAdiver = employeeService.selectOneByKey(user.getHisCorpUserId()); |
| | | //开发人门店标识(用户绑定的销售顾问) |
| | | ordersTotal.setDeveloperShopId(userShop.getId()); |
| | | //开发人门店名称 |
| | | ordersTotal.setDeveloperShopName(userShop.getName()); |
| | | ordersTotal.setDeveloperId(userAdiver.getId()); |
| | | ordersTotal.setDeveloperName(userAdiver.getCnName()); |
| | | }else{ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"请填写好开发人或者用户绑定一个销售顾问在重试"); |
| | | } |
| | | |
| | | } |
| | | // } |
| | | |
| | | setOrderTotal(ordersTotal, shop, totalPrice, shouldOrderTotal, discountTotal,operatorId,operatorName,operatorType); |
| | | |
| | |
| | | userProjectItem.setUserProjectId(userProject.getId());//用户项目id |
| | | userProjectItem.setUserId(ordersTotal.getUserId());//用户id |
| | | userProjectItem.setOrderItemId(vo.getId()); // 存OrderItemId |
| | | userProjectItem.setDepartmentCode(ordersTotal.getDepartmentCode());//科室编码 |
| | | userProjectItem.setDepartmentName(ordersTotal.getDepartmentName());//科室名称 |
| | | userProjectItem.setShopId(ordersTotal.getDeveloperShopId());//开单人门店id |
| | | userProjectItem.setShopName(ordersTotal.getShopName());//开单人门店名称 |
| | | } |
| | | |
| | | private void setUserProject(OrdersTotal ordersTotal, UserProject userProject, OrderItem vo) { |
| | |
| | | |
| | | @Override |
| | | public void updatePay(OrdersTotal ordersTotal) { |
| | | ordersTotalMapper.updatePay(ordersTotal.getPayRecharge(),ordersTotal.getPayIncrement(),ordersTotal.getPayTotal(),ordersTotal.getStatus(),ordersTotal.getId(),ordersTotal.getPayTime(),ordersTotal.getPayStatus()); |
| | | ordersTotalMapper.updatePay(ordersTotal.getActualTotal(),ordersTotal.getPayRecharge(),ordersTotal.getPayIncrement(),ordersTotal.getPayTotal(),ordersTotal.getStatus(),ordersTotal.getId(),ordersTotal.getPayTime(),ordersTotal.getPayStatus()); |
| | | } |
| | | |
| | | /**查询条数*/ |