未约未排

This commit is contained in:
kuang.yife 2023-06-04 01:40:36 +08:00
parent 8ad615c8b7
commit 5b54770a40
9 changed files with 501 additions and 10 deletions

View File

@ -0,0 +1,136 @@
package com.ghy.web.controller.order;
import java.util.List;
import com.ghy.order.domain.OrderCallRecord;
import com.ghy.order.service.IOrderCallRecordService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ghy.common.annotation.Log;
import com.ghy.common.enums.BusinessType;
import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.common.core.page.TableDataInfo;
/**
* 订单约单记录Controller
*
* @author clunt
* @date 2023-06-04
*/
@Controller
@RequestMapping("/order/record")
public class OrderCallRecordController extends BaseController
{
private String prefix = "order/record";
@Autowired
private IOrderCallRecordService orderCallRecordService;
@RequiresPermissions("worker:record:view")
@GetMapping()
public String record()
{
return prefix + "/record";
}
/**
* 查询订单约单记录列表
*/
@RequiresPermissions("worker:record:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OrderCallRecord orderCallRecord)
{
startPage();
List<OrderCallRecord> list = orderCallRecordService.selectOrderCallRecordList(orderCallRecord);
return getDataTable(list);
}
/**
* App查询订单约单记录列表
*/
@PostMapping("/app/list")
@ResponseBody
public TableDataInfo appList(@RequestBody OrderCallRecord orderCallRecord)
{
startPage();
List<OrderCallRecord> list = orderCallRecordService.selectOrderCallRecordList(orderCallRecord);
return getDataTable(list);
}
/**
* 导出订单约单记录列表
*/
@RequiresPermissions("worker:record:export")
@Log(title = "订单约单记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OrderCallRecord orderCallRecord)
{
List<OrderCallRecord> list = orderCallRecordService.selectOrderCallRecordList(orderCallRecord);
ExcelUtil<OrderCallRecord> util = new ExcelUtil<OrderCallRecord>(OrderCallRecord.class);
return util.exportExcel(list, "订单约单记录数据");
}
/**
* 新增订单约单记录
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存订单约单记录
*/
@RequiresPermissions("worker:record:add")
@Log(title = "订单约单记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(OrderCallRecord orderCallRecord)
{
return toAjax(orderCallRecordService.insertOrderCallRecord(orderCallRecord));
}
/**
* 修改订单约单记录
*/
@RequiresPermissions("worker:record:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
OrderCallRecord orderCallRecord = orderCallRecordService.selectOrderCallRecordById(id);
mmap.put("orderCallRecord", orderCallRecord);
return prefix + "/edit";
}
/**
* 修改保存订单约单记录
*/
@RequiresPermissions("worker:record:edit")
@Log(title = "订单约单记录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(OrderCallRecord orderCallRecord)
{
return toAjax(orderCallRecordService.updateOrderCallRecord(orderCallRecord));
}
/**
* 删除订单约单记录
*/
@RequiresPermissions("worker:record:remove")
@Log(title = "订单约单记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(orderCallRecordService.deleteOrderCallRecordByIds(ids));
}
}

View File

@ -24,14 +24,8 @@ import com.ghy.goods.service.GoodsAreaService;
import com.ghy.goods.service.GoodsImgsService; import com.ghy.goods.service.GoodsImgsService;
import com.ghy.goods.service.GoodsService; import com.ghy.goods.service.GoodsService;
import com.ghy.goods.service.GoodsStandardService; import com.ghy.goods.service.GoodsStandardService;
import com.ghy.order.domain.AfterServiceRecord; import com.ghy.order.domain.*;
import com.ghy.order.domain.OrderDetail; import com.ghy.order.service.*;
import com.ghy.order.domain.OrderGoods;
import com.ghy.order.domain.OrderMaster;
import com.ghy.order.service.IAfterServiceRecordService;
import com.ghy.order.service.OrderDetailService;
import com.ghy.order.service.OrderGoodsService;
import com.ghy.order.service.OrderMasterService;
import com.ghy.payment.domain.FinancialChangeRecord; import com.ghy.payment.domain.FinancialChangeRecord;
import com.ghy.payment.domain.FinancialDetail; import com.ghy.payment.domain.FinancialDetail;
import com.ghy.payment.domain.FinancialMaster; import com.ghy.payment.domain.FinancialMaster;
@ -110,6 +104,8 @@ public class OrderMasterController extends BaseController {
private IAfterServiceRecordService afterServiceRecordService; private IAfterServiceRecordService afterServiceRecordService;
@Resource @Resource
private FinancialChangeRecordService financialChangeRecordService; private FinancialChangeRecordService financialChangeRecordService;
@Autowired
private IOrderCallRecordService orderCallRecordService;
@RequiresPermissions("order:master:view") @RequiresPermissions("order:master:view")
@GetMapping() @GetMapping()
@ -726,6 +722,25 @@ public class OrderMasterController extends BaseController {
} }
} }
@PostMapping("/callCustomer")
@ResponseBody
public AjaxResult callCustomer(@RequestBody OrderMaster orderMaster) {
try {
int i = orderMasterService.updateOrderMaster(orderMaster);
if(i > 0){
OrderCallRecord param = new OrderCallRecord();
param.setOrderId(orderMaster.getId());
param.setCallTime(new Date());
param.setOrderType("01");
orderCallRecordService.insertOrderCallRecord(param);
}
return AjaxResult.success();
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error();
}
}
/** /**
* 校验主订单编码 * 校验主订单编码
*/ */

View File

@ -0,0 +1,36 @@
package com.ghy.order.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity;
/**
* 订单约单记录对象 order_call_record
*
* @author clunt
* @date 2023-06-04
*/
@Data
public class OrderCallRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 订单号 */
@Excel(name = "订单号")
private Long orderId;
/** 订单类型 01.主单 02.子单 */
@Excel(name = "订单类型 01.主单 02.子单")
private String orderType;
/** 联系时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "联系时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date callTime;
}

View File

@ -143,4 +143,10 @@ public class OrderMaster extends BaseEntity {
private String orderMode; private String orderMode;
private Integer sysPayStatus; private Integer sysPayStatus;
/**
* 是否约单
* */
private String isCall;
} }

View File

@ -0,0 +1,63 @@
package com.ghy.order.mapper;
import com.ghy.order.domain.OrderCallRecord;
import java.util.List;
/**
* 订单约单记录Mapper接口
*
* @author clunt
* @date 2023-06-04
*/
public interface OrderCallRecordMapper
{
/**
* 查询订单约单记录
*
* @param id 订单约单记录主键
* @return 订单约单记录
*/
public OrderCallRecord selectOrderCallRecordById(Long id);
/**
* 查询订单约单记录列表
*
* @param orderCallRecord 订单约单记录
* @return 订单约单记录集合
*/
public List<OrderCallRecord> selectOrderCallRecordList(OrderCallRecord orderCallRecord);
/**
* 新增订单约单记录
*
* @param orderCallRecord 订单约单记录
* @return 结果
*/
public int insertOrderCallRecord(OrderCallRecord orderCallRecord);
/**
* 修改订单约单记录
*
* @param orderCallRecord 订单约单记录
* @return 结果
*/
public int updateOrderCallRecord(OrderCallRecord orderCallRecord);
/**
* 删除订单约单记录
*
* @param id 订单约单记录主键
* @return 结果
*/
public int deleteOrderCallRecordById(Long id);
/**
* 批量删除订单约单记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteOrderCallRecordByIds(String[] ids);
}

View File

@ -0,0 +1,62 @@
package com.ghy.order.service;
import com.ghy.order.domain.OrderCallRecord;
import java.util.List;
/**
* 订单约单记录Service接口
*
* @author clunt
* @date 2023-06-04
*/
public interface IOrderCallRecordService
{
/**
* 查询订单约单记录
*
* @param id 订单约单记录主键
* @return 订单约单记录
*/
public OrderCallRecord selectOrderCallRecordById(Long id);
/**
* 查询订单约单记录列表
*
* @param orderCallRecord 订单约单记录
* @return 订单约单记录集合
*/
public List<OrderCallRecord> selectOrderCallRecordList(OrderCallRecord orderCallRecord);
/**
* 新增订单约单记录
*
* @param orderCallRecord 订单约单记录
* @return 结果
*/
public int insertOrderCallRecord(OrderCallRecord orderCallRecord);
/**
* 修改订单约单记录
*
* @param orderCallRecord 订单约单记录
* @return 结果
*/
public int updateOrderCallRecord(OrderCallRecord orderCallRecord);
/**
* 批量删除订单约单记录
*
* @param ids 需要删除的订单约单记录主键集合
* @return 结果
*/
public int deleteOrderCallRecordByIds(String ids);
/**
* 删除订单约单记录信息
*
* @param id 订单约单记录主键
* @return 结果
*/
public int deleteOrderCallRecordById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.ghy.order.service.impl;
import java.util.List;
import com.ghy.order.domain.OrderCallRecord;
import com.ghy.order.mapper.OrderCallRecordMapper;
import com.ghy.order.service.IOrderCallRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ghy.common.core.text.Convert;
/**
* 订单约单记录Service业务层处理
*
* @author clunt
* @date 2023-06-04
*/
@Service
public class OrderCallRecordServiceImpl implements IOrderCallRecordService
{
@Autowired
private OrderCallRecordMapper orderCallRecordMapper;
/**
* 查询订单约单记录
*
* @param id 订单约单记录主键
* @return 订单约单记录
*/
@Override
public OrderCallRecord selectOrderCallRecordById(Long id)
{
return orderCallRecordMapper.selectOrderCallRecordById(id);
}
/**
* 查询订单约单记录列表
*
* @param orderCallRecord 订单约单记录
* @return 订单约单记录
*/
@Override
public List<OrderCallRecord> selectOrderCallRecordList(OrderCallRecord orderCallRecord)
{
return orderCallRecordMapper.selectOrderCallRecordList(orderCallRecord);
}
/**
* 新增订单约单记录
*
* @param orderCallRecord 订单约单记录
* @return 结果
*/
@Override
public int insertOrderCallRecord(OrderCallRecord orderCallRecord)
{
return orderCallRecordMapper.insertOrderCallRecord(orderCallRecord);
}
/**
* 修改订单约单记录
*
* @param orderCallRecord 订单约单记录
* @return 结果
*/
@Override
public int updateOrderCallRecord(OrderCallRecord orderCallRecord)
{
return orderCallRecordMapper.updateOrderCallRecord(orderCallRecord);
}
/**
* 批量删除订单约单记录
*
* @param ids 需要删除的订单约单记录主键
* @return 结果
*/
@Override
public int deleteOrderCallRecordByIds(String ids)
{
return orderCallRecordMapper.deleteOrderCallRecordByIds(Convert.toStrArray(ids));
}
/**
* 删除订单约单记录信息
*
* @param id 订单约单记录主键
* @return 结果
*/
@Override
public int deleteOrderCallRecordById(Long id)
{
return orderCallRecordMapper.deleteOrderCallRecordById(id);
}
}

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ghy.order.mapper.OrderCallRecordMapper">
<resultMap type="OrderCallRecord" id="OrderCallRecordResult">
<result property="id" column="id" />
<result property="orderId" column="order_id" />
<result property="orderType" column="order_type" />
<result property="callTime" column="call_time" />
</resultMap>
<sql id="selectOrderCallRecordVo">
select id, order_id, order_type, call_time from order_call_record
</sql>
<select id="selectOrderCallRecordList" parameterType="OrderCallRecord" resultMap="OrderCallRecordResult">
<include refid="selectOrderCallRecordVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
<if test="callTime != null "> and call_time = #{callTime}</if>
</where>
</select>
<select id="selectOrderCallRecordById" parameterType="Long" resultMap="OrderCallRecordResult">
<include refid="selectOrderCallRecordVo"/>
where id = #{id}
</select>
<insert id="insertOrderCallRecord" parameterType="OrderCallRecord" useGeneratedKeys="true" keyProperty="id">
insert into order_call_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="orderType != null">order_type,</if>
<if test="callTime != null">call_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="orderType != null">#{orderType},</if>
<if test="callTime != null">#{callTime},</if>
</trim>
</insert>
<update id="updateOrderCallRecord" parameterType="OrderCallRecord">
update order_call_record
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="callTime != null">call_time = #{callTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOrderCallRecordById" parameterType="Long">
delete from order_call_record where id = #{id}
</delete>
<delete id="deleteOrderCallRecordByIds" parameterType="String">
delete from order_call_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -30,6 +30,7 @@
<result property="hasDispatchedAll" column="has_dispatched_all"/> <result property="hasDispatchedAll" column="has_dispatched_all"/>
<result property="timeout" column="timeout_"/> <result property="timeout" column="timeout_"/>
<result property="timeoutFineTimes" column="timeout_fine_times"/> <result property="timeoutFineTimes" column="timeout_fine_times"/>
<result property="isCall" column="is_call" />
</resultMap> </resultMap>
<sql id="selectOrderMaster"> <sql id="selectOrderMaster">
@ -55,7 +56,8 @@
all_self_assigned, all_self_assigned,
goods_id, goods_id,
timeout_, timeout_,
timeout_fine_times timeout_fine_times,
is_call
FROM order_master FROM order_master
</sql> </sql>
<sql id="selectOrderMasterMoreInfo"> <sql id="selectOrderMasterMoreInfo">
@ -81,7 +83,8 @@
om.all_self_assigned, om.all_self_assigned,
om.goods_id, om.goods_id,
om.timeout_, om.timeout_,
om.timeout_fine_times om.timeout_fine_times,
om.is_call
FROM order_master om FROM order_master om
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
LEFT JOIN goods g ON g.goods_id = om.goods_id LEFT JOIN goods g ON g.goods_id = om.goods_id
@ -177,6 +180,9 @@
<if test="timeout != null"> <if test="timeout != null">
AND om.timeout_ = #{timeout} AND om.timeout_ = #{timeout}
</if> </if>
<if test="isCall != null">
AND om.ic_call = #{isCall}
</if>
</where> </where>
order by om.create_time order by om.create_time
<trim suffixOverrides=","> <trim suffixOverrides=",">
@ -239,6 +245,9 @@
<if test="orderMasterIds != null and orderMasterIds != ''"> <if test="orderMasterIds != null and orderMasterIds != ''">
AND om.id in (${orderMasterIds}) AND om.id in (${orderMasterIds})
</if> </if>
<if test="isCall != null">
AND om.ic_call = #{isCall}
</if>
</where> </where>
</select> </select>
@ -280,6 +289,7 @@
<if test="allSelfAssigned != null">all_self_assigned = #{allSelfAssigned},</if> <if test="allSelfAssigned != null">all_self_assigned = #{allSelfAssigned},</if>
<if test="resetAllSelfAssigned">all_self_assigned = null,</if> <if test="resetAllSelfAssigned">all_self_assigned = null,</if>
<if test="hasDispatchedAll != null">has_dispatched_all = #{hasDispatchedAll},</if> <if test="hasDispatchedAll != null">has_dispatched_all = #{hasDispatchedAll},</if>
<if test="isCall != null">is_call = #{isCall},</if>
update_time = SYSDATE() update_time = SYSDATE()
</set> </set>
WHERE id = #{id} WHERE id = #{id}