| | |
| | | import com.taoke.autopay.entity.js2.OrderTaskExecutionDetail; |
| | | import com.taoke.autopay.exception.OrderTaskException; |
| | | import com.taoke.autopay.factory.js2.OrderTaskFactory; |
| | | import com.taoke.autopay.service.js2.OrderTaskExecutionDetailService; |
| | | import com.taoke.autopay.service.js2.OrderTaskService; |
| | | import com.taoke.autopay.utils.TimeUtil; |
| | | import com.taoke.autopay.vo.admin.js2.OrderTaskVO; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.sql.Time; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | |
| | | return new Date(); |
| | | } |
| | | }).create(); |
| | | @Autowired |
| | | private OrderTaskExecutionDetailService orderTaskExecutionDetailService; |
| | | |
| | | /** |
| | | * 任务列表查询(按照关键字,日期查询) |
| | |
| | | return JsonUtil.loadFalseResult("系统异常:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("updateExpectedReviewTime") |
| | | public String updateExpectedReviewTime(String id, String expectedReviewTime) { |
| | | try { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | return JsonUtil.loadFalseResult("ID不能为空"); |
| | | } |
| | | |
| | | OrderTaskExecutionDetail update = OrderTaskExecutionDetail.builder() |
| | | .id( id) |
| | | .expectedReviewTime(new Date(TimeUtil.convertToTimeTemp(expectedReviewTime, "yyyy-MM-dd HH:mm:ss"))) |
| | | .updateTime(new Date()) |
| | | .build(); |
| | | orderTaskExecutionDetailService.updateOrderTaskExecutionDetail(update); |
| | | return JsonUtil.loadTrueResult(""); |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult("系统异常:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.taoke.autopay.entity.js2.OrderTaskExecutionDetail; |
| | | import com.taoke.autopay.factory.js2.OrderTaskExecutionDetailFactory; |
| | | import com.taoke.autopay.service.ClientAdditionalInfoService; |
| | | import com.taoke.autopay.service.ClientInfoService; |
| | | import com.taoke.autopay.service.js2.OrderTaskExecutionDetailService; |
| | | import com.taoke.autopay.service.js2.OrderTaskService; |
| | | import com.taoke.autopay.utils.TimeUtil; |
| | |
| | | @Controller |
| | | @RequestMapping("api/client/js2/task") |
| | | public class OrderTaskController { |
| | | |
| | | private Logger loggerDoOrder = LoggerFactory.getLogger("doOrderLogger"); |
| | | |
| | | @Resource |
| | | private ClientAdditionalInfoService clientAdditionalInfoService; |
| | |
| | | @Resource |
| | | private OrderTaskService orderTaskService; |
| | | |
| | | @Resource |
| | | private ClientInfoService clientInfoService; |
| | | |
| | | /** |
| | | * 获取设备可执行的任务列表 |
| | | * |
| | |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | | } |
| | | clientInfoService.setActiveTime(uid, new Date()); |
| | | List<OrderTaskExecutionDetailVO> voList= new ArrayList<>(); |
| | | List<OrderTaskExecutionDetail> list = orderTaskExecutionDetailService.listCanExcuteTaskDetail(uid, (page-1)*pageSize,pageSize); |
| | | if(!list.isEmpty()){ |
| | |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | voList.sort((o1, o2) -> (int) (o1.getCreateTime().getTime() - o2.getCreateTime().getTime())); |
| | | long count = orderTaskExecutionDetailService.countCanExcuteTaskDetail(uid); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", gson.toJson(voList)); |
| | | data.put("count", count); |
| | | return JsonUtil.loadTrueResult(data); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | loggerTask.error("获取任务列表失败: {}", e.getMessage(), e); |
| | | return JsonUtil.loadFalseResult("系统异常:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("canOrder") |
| | | public String canOrder(Long uid, String id) { |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | return JsonUtil.loadFalseResult("任务ID不能为空"); |
| | | } |
| | | |
| | | OrderTaskExecutionDetail detail = orderTaskExecutionDetailService.getOrderTaskExecutionDetailByIdForUpdate(id); |
| | | if (detail == null || detail.getExecutionStatus() != OrderTaskExecutionDetail.STATUS_NOT_ORDERED) { |
| | | return JsonUtil.loadFalseResult("任务不存在或已执行"); |
| | | } |
| | | return JsonUtil.loadTrueResult(""); |
| | | } |
| | | |
| | | /** |
| | | * 下单成功 |
| | | * |
| | | * @param uid 客户端ID |
| | | * @param id 任务执行详情ID |
| | | * @param id |
| | | * 任务执行详情ID |
| | | * @param orderNo 订单号 |
| | | * @param productTitle 商品标题 |
| | | * @param shopName 店铺名称 |
| | |
| | | @ResponseBody |
| | | @RequestMapping("orderSuccess") |
| | | public String orderSuccess(Long uid, String id, String orderNo, String productTitle, String shopName, String orderTimeStr) { |
| | | loggerTask.info("orderSuccess[{}]: {}-{}-{}-{}-{}", uid, id, orderNo, productTitle, shopName, orderTimeStr); |
| | | loggerDoOrder.info("下单成功[{}]: {}-{}-{}-{}-{}", uid, id, orderNo, productTitle, shopName, orderTimeStr); |
| | | try { |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | |
| | | if (StringUtil.isNullOrEmpty(orderNo)) { |
| | | return JsonUtil.loadFalseResult("订单号不能为空"); |
| | | } |
| | | |
| | | |
| | | orderNo = orderNo.split("订单编号")[1]; |
| | | |
| | | Date orderTime = null; |
| | | if (!StringUtil.isNullOrEmpty(orderTimeStr)) { |
| | |
| | | @ResponseBody |
| | | @RequestMapping("orderFailure") |
| | | public String orderFailure(Long uid, String id, String failureReason) { |
| | | loggerTask.info("orderFailure[{}]: {}-{}", uid, id, failureReason); |
| | | loggerDoOrder.info("下单失败[{}]: {}-{}", uid, id, failureReason); |
| | | try { |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | |
| | | @ResponseBody |
| | | @RequestMapping("confirmReceiptSuccess") |
| | | public String confirmReceiptSuccess(Long uid, String id, String couponCode) { |
| | | loggerTask.info("confirmReceiptSuccess[{}]: {}-{}", uid, id, couponCode); |
| | | loggerDoOrder.info("确认收货成功[{}]: {}-{}", uid, id, couponCode); |
| | | try { |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | |
| | | @ResponseBody |
| | | @RequestMapping("confirmReceiptFailure") |
| | | public String confirmReceiptFailure(Long uid, String id, String reason) { |
| | | loggerTask.info("confirmReceiptFailure[{}]: {}-{}", uid, id, reason); |
| | | loggerDoOrder.info("确认收货失败[{}]: {}-{}", uid, id, reason); |
| | | try { |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | |
| | | @ResponseBody |
| | | @RequestMapping("reviewSuccess") |
| | | public String reviewSuccess(Long uid, String id) { |
| | | loggerTask.info("reviewSuccess[{}]: {}", uid, id); |
| | | loggerDoOrder.info("评价成功[{}]: {}", uid, id); |
| | | try { |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | |
| | | @ResponseBody |
| | | @RequestMapping("reviewFailure") |
| | | public String reviewFailure(Long uid, String id, String reason) { |
| | | loggerTask.info("reviewFailure[{}]: {}-{}", uid, id, reason); |
| | | loggerDoOrder.info("评价失败[{}]: {}-{}", uid, id, reason); |
| | | try { |
| | | if (uid == null) { |
| | | return JsonUtil.loadFalseResult("客户端ID不能为空"); |
| | |
| | | public Date orderTime; |
| | | public Date receiveTime; |
| | | public Date reviewTime; |
| | | public Date expectedReviewTime; |
| | | public Date minCreateTime; |
| | | public Date maxCreateTime; |
| | | public Date minUpdateTime; |
| | |
| | | public Integer receivedOrderCount; |
| | | public Integer reviewedOrderCount; |
| | | public Integer receiveCycleHours; |
| | | public Integer receiveCycleMinutes; |
| | | public Date orderStartTime; |
| | | public Date orderEndTime; |
| | | public Date minCreateTime; |
| | |
| | | private Integer receiveCycleHours; |
| | | |
| | | /** |
| | | * 确认收货周期(分钟) |
| | | */ |
| | | @Column(name = "receive_cycle_minutes") |
| | | private Integer receiveCycleMinutes; |
| | | |
| | | /** |
| | | * 下单开始时间 |
| | | */ |
| | | @Column(name = "order_start_time") |
| | |
| | | */ |
| | | @Column(name = "review_time") |
| | | private Date reviewTime; |
| | | |
| | | /** |
| | | * 预计评价时间 |
| | | */ |
| | | @Column(name = "expected_review_time") |
| | | private Date expectedReviewTime; |
| | | |
| | | /** |
| | | * 创建时间 |
| | |
| | | .clientId(orderTaskExecutionDetail.getClientId()) |
| | | .orderNo(orderTaskExecutionDetail.getOrderNo()) |
| | | .productName(orderTaskExecutionDetail.getProductName()) |
| | | .shopName(orderTaskExecutionDetail.getShopName()); |
| | | .shopName(orderTaskExecutionDetail.getShopName()) |
| | | .expectedReviewTime(orderTaskExecutionDetail.getExpectedReviewTime()==null?"":TimeUtil.getGernalTime(orderTaskExecutionDetail.getExpectedReviewTime().getTime(),"yyyy-MM-dd HH:mm:ss")) |
| | | ; |
| | | |
| | | // 设置客户端附加信息 |
| | | if (clientAdditionalInfo != null) { |
| | |
| | | if (executionStatus != null) { |
| | | if (executionStatus == OrderTaskExecutionDetail.STATUS_NOT_ORDERED) { |
| | | builder.executionType(OrderTaskExecutionDetailVO.EXECUTION_TYPE_ORDER); |
| | | builder.createTime(orderTaskExecutionDetail.getCreateTime()); |
| | | } else if (executionStatus == OrderTaskExecutionDetail.STATUS_ORDERED) { |
| | | builder.executionType(OrderTaskExecutionDetailVO.EXECUTION_TYPE_RECEIVE); |
| | | builder.createTime(orderTaskExecutionDetail.getOrderTime()); |
| | | } else if (executionStatus == OrderTaskExecutionDetail.STATUS_RECEIVE_SUCCESS) { |
| | | builder.executionType(OrderTaskExecutionDetailVO.EXECUTION_TYPE_REVIEW); |
| | | builder.createTime(orderTaskExecutionDetail.getExpectedReviewTime()); |
| | | } |
| | | } |
| | | |
| | |
| | | if (!StringUtil.isNullOrEmpty(orderTask.getKeywordContent())) { |
| | | builder.key(orderTask.getKeywordContent()); |
| | | } |
| | | |
| | | // 处理时间字段 |
| | | if (orderTaskExecutionDetail.getCreateTime() != null) { |
| | | builder.createTime(TimeUtil.getGernalTime(orderTaskExecutionDetail.getCreateTime().getTime(), "yyyy-MM-dd HH:mm:ss")); |
| | | } |
| | | |
| | | |
| | | return builder.build(); |
| | | } |
| | | } |
| | |
| | | .completedOrderCount(orderTask.getCompletedOrderCount()) |
| | | .receivedOrderCount(orderTask.getReceivedOrderCount()) |
| | | .reviewedOrderCount(orderTask.getReviewedOrderCount()) |
| | | .receiveCycleHours(orderTask.getReceiveCycleHours()) |
| | | .receiveCycleMinutes(orderTask.getReceiveCycleMinutes()) |
| | | .status(orderTask.getStatus()) |
| | | .statusDescription(orderTask.getStatusDescription()); |
| | | |
| | |
| | | .completedOrderCount(orderTaskVO.getCompletedOrderCount()) |
| | | .receivedOrderCount(orderTaskVO.getReceivedOrderCount()) |
| | | .reviewedOrderCount(orderTaskVO.getReviewedOrderCount()) |
| | | .receiveCycleHours(orderTaskVO.getReceiveCycleHours()) |
| | | .receiveCycleMinutes(orderTaskVO.getReceiveCycleMinutes()) |
| | | .status(orderTaskVO.getStatus()) |
| | | .statusDescription(orderTaskVO.getStatusDescription()); |
| | | |
| | |
| | | i--; |
| | | continue; |
| | | } |
| | | if(StringUtil.isNullOrEmpty(info.getMobile())||StringUtil.isNullOrEmpty(info.getAlipayAccount())||StringUtil.isNullOrEmpty(info.getAlipayPassword())){ |
| | | if(StringUtil.isNullOrEmpty(info.getMobile())){ |
| | | clientInfoList.remove(i); |
| | | i--; |
| | | continue; |
| | |
| | | @Override |
| | | public List<OrderTaskExecutionDetail> listCanExcuteTaskDetail(Long clientId, int page, int pageSize) { |
| | | // 获取30分钟以内的订单任务执行详情 |
| | | return orderTaskExecutionDetailMapper.listCanExcuteTaskDetail(clientId, new Date(System.currentTimeMillis() - 1000*60*30L)); |
| | | return orderTaskExecutionDetailMapper.listCanExcuteTaskDetail(clientId, new Date(System.currentTimeMillis() - 1000*60*30L), (long) (page) *pageSize, pageSize); |
| | | } |
| | | |
| | | @Override |
| | |
| | | throw new OrderTaskException(OrderTaskException.CODE_COMMON, "下单任务需求下单数量不能为空"); |
| | | } |
| | | |
| | | if(orderTask.getReceiveCycleHours()==null){ |
| | | if(orderTask.getReceiveCycleMinutes()==null){ |
| | | throw new OrderTaskException(OrderTaskException.CODE_COMMON, "下单任务收货周期不能为空"); |
| | | } |
| | | |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Tolerate; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Builder |
| | | public class OrderTaskExecutionDetailVO { |
| | |
| | | private String mobile; |
| | | private String alipayAccount; |
| | | private String alipayPassword; |
| | | private String createTime; |
| | | private Date createTime; |
| | | private String expectedReviewTime; |
| | | } |
| | |
| | | private Integer reviewedOrderCount; |
| | | |
| | | /** |
| | | * 确认收货周期(小时) |
| | | * 确认收货周期(分钟) |
| | | */ |
| | | private Integer receiveCycleHours; |
| | | private Integer receiveCycleMinutes; |
| | | |
| | | /** |
| | | * 下单开始时间 |
| | |
| | | </appender> |
| | | |
| | | |
| | | <appender name="doOrderAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.filePath}/do_order.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${log.filePath}/do_order/do_order.log.gz.%d{yyyy-MM-dd}</fileNamePattern> |
| | | <maxHistory>${log.maxHistory}</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>DEBUG</level> |
| | | </filter> |
| | | </appender> |
| | | |
| | | |
| | | <logger name="dyorderApiLogger" level="INFO" additivity="false"> |
| | | <appender-ref ref="dyApiAppender"></appender-ref> |
| | | </logger> |
| | |
| | | <appender-ref ref="alipayAppender"></appender-ref> |
| | | </logger> |
| | | |
| | | <logger name="doOrderLogger" level="INFO" additivity="false"> |
| | | <appender-ref ref="doOrderAppender"></appender-ref> |
| | | </logger> |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <if test="subState !=null">sub_state =#{subState,jdbcType=INTEGER},</if> |
| | | </set> where id = #{id,jdbcType=VARCHAR} |
| | | </update> |
| | | <select id="listDistributeUids" resultMap="DistributeResultMap">SELECT u.`id` as uid, IF( a.count IS NULL,0,a.count) AS `count` FROM `table_user` u LEFT JOIN (SELECT o.`distribute_client_uid` AS uid,COUNT(*) AS `count` FROM `table_order` o WHERE o.`state` = 0 and create_time > #{minKeyOrderCreateTime} GROUP BY o.`distribute_client_uid`) a ON a.uid = u.`id` WHERE rule=0 |
| | | <select id="listDistributeUids" resultMap="DistributeResultMap">SELECT u.`id` as uid, IF( a.count IS NULL,0,a.count) AS `count` FROM `table_user` u LEFT JOIN (SELECT o.`distribute_client_uid` AS uid,COUNT(*) AS `count` FROM `table_order` o WHERE o.`state` = 0 and create_time > #{minKeyOrderCreateTime} GROUP BY o.`distribute_client_uid`) a ON a.uid = u.`id` WHERE rule=0 and client_type=0 |
| | | <if test="minActiveTime!=null">and active_time >=#{minActiveTime}</if> |
| | | </select> |
| | | <select id="listNotDistributed" resultMap="BaseResultMap">select |
| | |
| | | <result column="order_time" property="orderTime" jdbcType="TIMESTAMP"/> |
| | | <result column="receive_time" property="receiveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="review_time" property="reviewTime" jdbcType="TIMESTAMP"/> |
| | | <result column="expected_review_time" property="expectedReviewTime" jdbcType="TIMESTAMP"/> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,create_time,update_time</sql> |
| | | <sql id="Base_Column_List">id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,expected_review_time,create_time,update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">select |
| | | <include refid="Base_Column_List"/> |
| | | from table_order_task_execution_detail where id = #{id,jdbcType=VARCHAR} |
| | |
| | | <if test="query.orderTime!=null">AND order_time = #{query.orderTime}</if> |
| | | <if test="query.receiveTime!=null">AND receive_time = #{query.receiveTime}</if> |
| | | <if test="query.reviewTime!=null">AND review_time = #{query.reviewTime}</if> |
| | | <if test="query.expectedReviewTime!=null">AND expected_review_time = #{query.expectedReviewTime}</if> |
| | | <if test="query.minCreateTime!=null">AND create_time >= #{query.minCreateTime}</if> |
| | | <if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} > create_time</if> |
| | | <if test="query.minUpdateTime!=null">AND update_time >= #{query.minUpdateTime}</if> |
| | |
| | | |
| | | <select id="listCanExcuteTaskDetail" resultMap="BaseResultMap" > |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | d.* |
| | | from `table_order_task_execution_detail` d LEFT JOIN `table_order_task` t ON t.`id`=d.`task_id` |
| | | WHERE |
| | | client_id = #{clientId} |
| | | AND |
| | | ( |
| | | (d.`execution_status`=0 AND d.`create_time` > #{minCreateTime}) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_hours*60*60 < UNIX_TIMESTAMP(NOW())) |
| | | OR (d.`execution_status`=2) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_minutes*60) |
| | | OR (d.`execution_status`=2 AND d.expected_review_time is not null) |
| | | ) order by d.create_time limit #{start},#{count} |
| | | </select> |
| | | |
| | |
| | | AND |
| | | ( |
| | | (d.`execution_status`=0 AND d.`create_time` > #{minCreateTime}) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_hours*60*60 < UNIX_TIMESTAMP(NOW())) |
| | | OR (d.`execution_status`=2) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_minutes*60) |
| | | OR (d.`execution_status`=2 AND d.expected_review_time is not null) |
| | | ) |
| | | </select> |
| | | |
| | |
| | | <foreach collection="statusList" open="" separator=" or " item="status" > |
| | | execution_status=#{status} |
| | | </foreach> |
| | | |
| | | GROUP BY client_id |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.String">delete from table_order_task_execution_detail where id = #{id,jdbcType=VARCHAR}</delete> |
| | | <insert id="insert" parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail" useGeneratedKeys="true" |
| | | keyProperty="id">insert into table_order_task_execution_detail (id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,create_time,update_time) values (#{id,jdbcType=VARCHAR},#{taskId,jdbcType=BIGINT},#{clientId,jdbcType=BIGINT},#{executionStatus,jdbcType=INTEGER},#{statusDescription,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{productName,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR},#{couponCode,jdbcType=VARCHAR},#{orderTime,jdbcType=TIMESTAMP},#{receiveTime,jdbcType=TIMESTAMP},#{reviewTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | keyProperty="id">insert into table_order_task_execution_detail (id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,expected_review_time,create_time,update_time) values (#{id,jdbcType=VARCHAR},#{taskId,jdbcType=BIGINT},#{clientId,jdbcType=BIGINT},#{executionStatus,jdbcType=INTEGER},#{statusDescription,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{productName,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR},#{couponCode,jdbcType=VARCHAR},#{orderTime,jdbcType=TIMESTAMP},#{receiveTime,jdbcType=TIMESTAMP},#{reviewTime,jdbcType=TIMESTAMP},#{expectedReviewTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail" useGeneratedKeys="true" |
| | | keyProperty="id">insert into table_order_task_execution_detail |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="orderTime != null">order_time,</if> |
| | | <if test="receiveTime != null">receive_time,</if> |
| | | <if test="reviewTime != null">review_time,</if> |
| | | <if test="expectedReviewTime != null">expected_review_time,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | |
| | | <if test="orderTime != null">#{orderTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveTime != null">#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="reviewTime != null">#{reviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="expectedReviewTime != null">#{expectedReviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail">update table_order_task_execution_detail set task_id = #{taskId,jdbcType=BIGINT},client_id = #{clientId,jdbcType=BIGINT},execution_status = #{executionStatus,jdbcType=INTEGER},status_description = #{statusDescription,jdbcType=VARCHAR},order_no = #{orderNo,jdbcType=VARCHAR},product_name = #{productName,jdbcType=VARCHAR},shop_name = #{shopName,jdbcType=VARCHAR},coupon_code = #{couponCode,jdbcType=VARCHAR},order_time = #{orderTime,jdbcType=TIMESTAMP},receive_time = #{receiveTime,jdbcType=TIMESTAMP},review_time = #{reviewTime,jdbcType=TIMESTAMP},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=VARCHAR}</update> |
| | | parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail">update table_order_task_execution_detail set task_id = #{taskId,jdbcType=BIGINT},client_id = #{clientId,jdbcType=BIGINT},execution_status = #{executionStatus,jdbcType=INTEGER},status_description = #{statusDescription,jdbcType=VARCHAR},order_no = #{orderNo,jdbcType=VARCHAR},product_name = #{productName,jdbcType=VARCHAR},shop_name = #{shopName,jdbcType=VARCHAR},coupon_code = #{couponCode,jdbcType=VARCHAR},order_time = #{orderTime,jdbcType=TIMESTAMP},receive_time = #{receiveTime,jdbcType=TIMESTAMP},review_time = #{reviewTime,jdbcType=TIMESTAMP},expected_review_time = #{expectedReviewTime,jdbcType=TIMESTAMP},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=VARCHAR}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail">update table_order_task_execution_detail |
| | | <set> |
| | | <if test="taskId != null">task_id=#{taskId,jdbcType=BIGINT},</if> |
| | |
| | | <if test="orderTime != null">order_time=#{orderTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveTime != null">receive_time=#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="reviewTime != null">review_time=#{reviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="expectedReviewTime != null">expected_review_time=#{expectedReviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | |
| | | <result column="received_order_count" property="receivedOrderCount" jdbcType="INTEGER"/> |
| | | <result column="reviewed_order_count" property="reviewedOrderCount" jdbcType="INTEGER"/> |
| | | <result column="receive_cycle_hours" property="receiveCycleHours" jdbcType="INTEGER"/> |
| | | <result column="receive_cycle_minutes" property="receiveCycleMinutes" jdbcType="INTEGER"/> |
| | | <result column="order_start_time" property="orderStartTime" jdbcType="TIMESTAMP"/> |
| | | <result column="order_end_time" property="orderEndTime" jdbcType="TIMESTAMP"/> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | |
| | | <result column="status" property="status" jdbcType="INTEGER"/> |
| | | <result column="status_description" property="statusDescription" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,keyword_content,keyword_md5,product_source,product_name,shop_name,required_order_count,completed_order_count,received_order_count,reviewed_order_count,receive_cycle_hours,order_start_time,order_end_time,create_time,update_time,estimated_receive_time,status,status_description</sql> |
| | | <sql id="Base_Column_List">id,keyword_content,keyword_md5,product_source,product_name,shop_name,required_order_count,completed_order_count,received_order_count,reviewed_order_count,receive_cycle_hours,receive_cycle_minutes,order_start_time,order_end_time,create_time,update_time,estimated_receive_time,status,status_description</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/> |
| | | from table_order_task where id = #{id,jdbcType=BIGINT} |
| | |
| | | <if test="query.receivedOrderCount!=null">AND received_order_count = #{query.receivedOrderCount}</if> |
| | | <if test="query.reviewedOrderCount!=null">AND reviewed_order_count = #{query.reviewedOrderCount}</if> |
| | | <if test="query.receiveCycleHours!=null">AND receive_cycle_hours = #{query.receiveCycleHours}</if> |
| | | <if test="query.receiveCycleMinutes!=null">AND receive_cycle_minutes = #{query.receiveCycleMinutes}</if> |
| | | <if test="query.orderStartTime!=null">AND order_start_time = #{query.orderStartTime}</if> |
| | | <if test="query.orderEndTime!=null">AND order_end_time = #{query.orderEndTime}</if> |
| | | <if test="query.minCreateTime!=null">AND create_time >= #{query.minCreateTime}</if> |
| | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from table_order_task where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.taoke.autopay.entity.js2.OrderTask" useGeneratedKeys="true" |
| | | keyProperty="id">insert into table_order_task (id,keyword_content,keyword_md5,product_source,product_name,shop_name,required_order_count,completed_order_count,received_order_count,reviewed_order_count,receive_cycle_hours,order_start_time,order_end_time,create_time,update_time,estimated_receive_time,status,status_description) values (#{id,jdbcType=BIGINT},#{keywordContent,jdbcType=VARCHAR},#{keywordMd5,jdbcType=VARCHAR},#{productSource,jdbcType=INTEGER},#{productName,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR},#{requiredOrderCount,jdbcType=INTEGER},#{completedOrderCount,jdbcType=INTEGER},#{receivedOrderCount,jdbcType=INTEGER},#{reviewedOrderCount,jdbcType=INTEGER},#{receiveCycleHours,jdbcType=INTEGER},#{orderStartTime,jdbcType=TIMESTAMP},#{orderEndTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{estimatedReceiveTime,jdbcType=TIMESTAMP},#{status,jdbcType=INTEGER},#{statusDescription,jdbcType=VARCHAR})</insert> |
| | | keyProperty="id">insert into table_order_task (id,keyword_content,keyword_md5,product_source,product_name,shop_name,required_order_count,completed_order_count,received_order_count,reviewed_order_count,receive_cycle_hours,receive_cycle_minutes,order_start_time,order_end_time,create_time,update_time,estimated_receive_time,status,status_description) values (#{id,jdbcType=BIGINT},#{keywordContent,jdbcType=VARCHAR},#{keywordMd5,jdbcType=VARCHAR},#{productSource,jdbcType=INTEGER},#{productName,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR},#{requiredOrderCount,jdbcType=INTEGER},#{completedOrderCount,jdbcType=INTEGER},#{receivedOrderCount,jdbcType=INTEGER},#{reviewedOrderCount,jdbcType=INTEGER},#{receiveCycleHours,jdbcType=INTEGER},#{receiveCycleMinutes,jdbcType=INTEGER},#{orderStartTime,jdbcType=TIMESTAMP},#{orderEndTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{estimatedReceiveTime,jdbcType=TIMESTAMP},#{status,jdbcType=INTEGER},#{statusDescription,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.taoke.autopay.entity.js2.OrderTask" useGeneratedKeys="true" |
| | | keyProperty="id">insert into table_order_task |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="receivedOrderCount != null">received_order_count,</if> |
| | | <if test="reviewedOrderCount != null">reviewed_order_count,</if> |
| | | <if test="receiveCycleHours != null">receive_cycle_hours,</if> |
| | | <if test="receiveCycleMinutes != null">receive_cycle_minutes,</if> |
| | | <if test="orderStartTime != null">order_start_time,</if> |
| | | <if test="orderEndTime != null">order_end_time,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | <if test="receivedOrderCount != null">#{receivedOrderCount,jdbcType=INTEGER},</if> |
| | | <if test="reviewedOrderCount != null">#{reviewedOrderCount,jdbcType=INTEGER},</if> |
| | | <if test="receiveCycleHours != null">#{receiveCycleHours,jdbcType=INTEGER},</if> |
| | | <if test="receiveCycleMinutes != null">#{receiveCycleMinutes,jdbcType=INTEGER},</if> |
| | | <if test="orderStartTime != null">#{orderStartTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="orderEndTime != null">#{orderEndTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.taoke.autopay.entity.js2.OrderTask">update table_order_task set keyword_content = #{keywordContent,jdbcType=VARCHAR},keyword_md5 = #{keywordMd5,jdbcType=VARCHAR},product_source = #{productSource,jdbcType=INTEGER},product_name = #{productName,jdbcType=VARCHAR},shop_name = #{shopName,jdbcType=VARCHAR},required_order_count = #{requiredOrderCount,jdbcType=INTEGER},completed_order_count = #{completedOrderCount,jdbcType=INTEGER},received_order_count = #{receivedOrderCount,jdbcType=INTEGER},reviewed_order_count = #{reviewedOrderCount,jdbcType=INTEGER},receive_cycle_hours = #{receiveCycleHours,jdbcType=INTEGER},order_start_time = #{orderStartTime,jdbcType=TIMESTAMP},order_end_time = #{orderEndTime,jdbcType=TIMESTAMP},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP},estimated_receive_time = #{estimatedReceiveTime,jdbcType=TIMESTAMP},status = #{status,jdbcType=INTEGER},status_description = #{statusDescription,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}</update> |
| | | parameterType="com.taoke.autopay.entity.js2.OrderTask">update table_order_task set keyword_content = #{keywordContent,jdbcType=VARCHAR},keyword_md5 = #{keywordMd5,jdbcType=VARCHAR},product_source = #{productSource,jdbcType=INTEGER},product_name = #{productName,jdbcType=VARCHAR},shop_name = #{shopName,jdbcType=VARCHAR},required_order_count = #{requiredOrderCount,jdbcType=INTEGER},completed_order_count = #{completedOrderCount,jdbcType=INTEGER},received_order_count = #{receivedOrderCount,jdbcType=INTEGER},reviewed_order_count = #{reviewedOrderCount,jdbcType=INTEGER},receive_cycle_hours = #{receiveCycleHours,jdbcType=INTEGER},receive_cycle_minutes = #{receiveCycleMinutes,jdbcType=INTEGER},order_start_time = #{orderStartTime,jdbcType=TIMESTAMP},order_end_time = #{orderEndTime,jdbcType=TIMESTAMP},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP},estimated_receive_time = #{estimatedReceiveTime,jdbcType=TIMESTAMP},status = #{status,jdbcType=INTEGER},status_description = #{statusDescription,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.js2.OrderTask">update table_order_task |
| | | <set> |
| | | <if test="keywordContent != null">keyword_content=#{keywordContent,jdbcType=VARCHAR},</if> |
| | |
| | | <if test="receivedOrderCount != null">received_order_count=#{receivedOrderCount,jdbcType=INTEGER},</if> |
| | | <if test="reviewedOrderCount != null">reviewed_order_count=#{reviewedOrderCount,jdbcType=INTEGER},</if> |
| | | <if test="receiveCycleHours != null">receive_cycle_hours=#{receiveCycleHours,jdbcType=INTEGER},</if> |
| | | <if test="receiveCycleMinutes != null">receive_cycle_minutes=#{receiveCycleMinutes,jdbcType=INTEGER},</if> |
| | | <if test="orderStartTime != null">order_start_time=#{orderStartTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="orderEndTime != null">order_end_time=#{orderEndTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | width: 120 |
| | | }, |
| | | { |
| | | field: 'additionalInfo.alipayAccount', |
| | | title: '支付宝账号', |
| | | width: 180 |
| | | }, |
| | | { |
| | | field: 'client.createTime', |
| | | title: '创建时间', |
| | | width: 180 |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">支付宝账号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="alipayAccount" required lay-verify="required" placeholder="支付宝账号" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">支付宝密码:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="password" name="alipayPassword" required lay-verify="" placeholder="无更改无需填写" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-input-block"> |
| | | <button class="layui-btn layui-btn-normal" lay-submit lay-filter="sure" id="sure">确定</button> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 修改预计评价时间弹窗 --> |
| | | <div id="updateExpectedReviewTime" style="display: none; padding: 20px;"> |
| | | <form class="layui-form" action=""> |
| | | <input type="hidden" name="id" id="detailId"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">预计评价时间</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="expectedReviewTime" id="expectedReviewTime" placeholder="请选择预计评价时间" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-input-block"> |
| | | <button class="layui-btn" lay-submit lay-filter="updateExpectedReviewTime">确定</button> |
| | | <button type="reset" class="layui-btn layui-btn-primary">重置</button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script src="/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script> |
| | | <script src="/admin/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> |
| | | <script> |
| | | layui.use(['table', 'layer'], function () { |
| | | layui.use(['table', 'layer', 'laydate'], function () { |
| | | var table = layui.table; |
| | | var layer = layui.layer; |
| | | var laydate = layui.laydate; |
| | | var urlParams = new URLSearchParams(window.location.search); |
| | | var taskId = urlParams.get('taskId'); |
| | | |
| | |
| | | {field: 'statusDescription', title: '状态说明', width: 150}, |
| | | {field: 'orderTime', title: '下单时间', width: 160}, |
| | | {field: 'receiveTime', title: '收货时间', width: 160}, |
| | | {field: 'expectedReviewTime', title: '预估评价时间', width: 160}, |
| | | {field: 'reviewTime', title: '评价时间', width: 160}, |
| | | |
| | | {field: 'createTime', title: '创建时间', width: 160}, |
| | | {field: 'updateTime', title: '更新时间', width: 160} |
| | | {field: 'updateTime', title: '更新时间', width: 160}, |
| | | { |
| | | title: '操作', width: 120, align: 'center', fixed: "right", templet: function (d) { |
| | | return "<a href='javascript:void(0)' class='layui-table-link' onclick=\"updateExpectedReviewTime('" + d.id + "')\">设置预估时间</a>"; |
| | | } |
| | | }, |
| | | ]] |
| | | }); |
| | | |
| | | // 修改预计评价时间 |
| | | window.updateExpectedReviewTime = function(id, expectedReviewTime) { |
| | | // 设置表单值 |
| | | $("#detailId").val(id); |
| | | $("#expectedReviewTime").val(expectedReviewTime); |
| | | |
| | | // 弹出修改窗口 |
| | | layer.open({ |
| | | type: 1, |
| | | title: "修改预计评价时间", |
| | | content: $("#updateExpectedReviewTime"), |
| | | area: ['500px', '300px'], |
| | | end: function() { |
| | | $("#updateExpectedReviewTime").css("display", "none"); |
| | | } |
| | | }); |
| | | |
| | | // 初始化日期控件 |
| | | laydate.render({ |
| | | elem: '#expectedReviewTime', |
| | | type: 'datetime', |
| | | theme: '#448aff', |
| | | value: expectedReviewTime |
| | | }); |
| | | }; |
| | | |
| | | // 监听表单提交 |
| | | layui.form.on('submit(updateExpectedReviewTime)', function(data) { |
| | | $.post("/admin/api/ordertask/js2/updateExpectedReviewTime", data.field, function(response) { |
| | | if (response.code == 0) { |
| | | layer.msg("修改成功"); |
| | | layer.closeAll('page'); |
| | | // 重新加载表格 |
| | | tableIns.reload(); |
| | | } else { |
| | | layer.msg(response.msg); |
| | | } |
| | | }, 'json').fail(function(jqXHR, textStatus, errorThrown) { |
| | | layer.msg("网络请求失败"); |
| | | }); |
| | | |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
| | | </body> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">收货周期(小时)</label> |
| | | <label class="layui-form-label">收货周期(分钟)</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="receiveCycleHours" required lay-verify="required|number" min="1" |
| | | placeholder="请输入收货周期(小时)" autocomplete="off" class="layui-input"> |
| | | <input type="number" name="receiveCycleMinutes" required lay-verify="required|number" min="1" |
| | | placeholder="请输入收货周期(分钟)" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | {field: 'completedOrderCount', title: '已下单数', width: 90}, |
| | | {field: 'receivedOrderCount', title: '已收货数', width: 90}, |
| | | {field: 'reviewedOrderCount', title: '已评价数', width: 90}, |
| | | {field: 'receiveCycleHours', title: '收货周期(小时)', width: 120}, |
| | | {field: 'receiveCycleMinutes', title: '收货周期(分钟)', width: 120}, |
| | | {field: 'orderStartTime', title: '下单开始时间', width: 160}, |
| | | {field: 'orderEndTime', title: '下单结束时间', width: 160}, |
| | | {field: 'createTime', title: '创建时间', width: 160}, |
| | |
| | | let html = '<div>'; |
| | | html += '<a href="javascript:void(0)" onclick="updateTask(' + d.id + ')" class="layui-table-link">修改</a> '; |
| | | html += '<a href="javascript:void(0)" onclick="deleteTask(' + d.id + ')" class="layui-table-link">删除</a> '; |
| | | if (d.status == 0) { |
| | | html += '<a href="javascript:void(0)" onclick="assignTask(' + d.id + ')" class="layui-table-link">分配</a>'; |
| | | }else{ |
| | | html += '<a href="javascript:void(0)" onclick="viewAssignedClients(' + d.id + ')" class="layui-table-link">已分配设备</a>'; |
| | | |
| | | html += '<a href="javascript:void(0)" onclick="assignTask(' + d.id + ')" class="layui-table-link">分配</a> '; |
| | | |
| | | if (d.status != 0) |
| | | { |
| | | html += '<a href="javascript:void(0)" onclick="viewAssignedClients(' + d.id + ')" class="layui-table-link">已分配设备</a> '; |
| | | } |
| | | html += '</div>'; |
| | | return html; |
| | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">收货周期(小时):</label> |
| | | <label class="layui-form-label">收货周期(分钟):</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="receiveCycleHours" required lay-verify="required|number" min="1" |
| | | placeholder="收货周期(小时)" autocomplete="off" class="layui-input"> |
| | | <input type="number" name="receiveCycleMinutes" required lay-verify="required|number" min="1" |
| | | placeholder="收货周期(分钟)" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |