发货,未发货

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="../Day08/js/jquery-3.2.1.min.js"></script>
<script src="../Day08/js/angular.min.js"></script>
<script src="../Day08/js/angular-route.js"></script>
<script type="text/javascript"></script>
<script>
var app = angular.module("Lj",[]);
app.controller("cont",function($scope){
$scope.px = '-id';


$scope.stus = [{id:2,shopname:'手机',name:'曹操',tel:15151515151,money:4990,city:"北京",regdate:new Date(),zt:"已发货"},
{id:10,shopname:'电脑',name:'张三',tel:15915915915,money:8451,city:"上海",regdate:new Date(),zt:"未发货"},
{id:5,shopname:'平板',name:'小乔',tel:45646416541,money:5615,city:"重庆",regdate:new Date(),zt:"已发货"},
{id:6,shopname:'音响',name:'李四',tel:49865248956,money:2155,city:"天津",regdate:new Date(),zt:"未发货"},
{id:4,shopname:'电宝',name:'金柯',tel:78946465165,money:4856,city:"北京",regdate:new Date(),zt:"已发货"},
];

$scope.formShow = false;
$scope.formShowFun = function(){
if($scope.formShow){
$scope.formShow = false;
}else{
$scope.formShow = true;

}
}

$scope.newid = "";
$scope.newname = "";
$scope.newhname = "";
$scope.newtel = "";
$scope.newprice = "";
$scope.newcity = "";
$scope.newtype = "";
$scope.checkSub = [];
$scope.divShow = false;
$scope.sub = function(){
$scope.checkSub = [];
if($scope.newid == "" || $scope.newid == null){
$scope.checkSub.push("产品编号为空")
}else if(isNaN($scope.newid)){
$scope.checkSub.push("产品编号不是整数")
}
}

$scope.dele = function(){
var count = 0;
for(var i=0; i<$scope.stus.length; i++){
if($scope.stus[i].ck){
count++;
$scope.stus.splice(i,1);
i--;
}
}
if(count == 0){
alert("请选择")
}
}

$scope.ckAll = function(){
for(var i=0; i<$scope.stus.length;i++){
$scope.stus[i].ck = $scope.flag;
}
}

$scope.delete = function($index){
if($index>=0){
if(confirm("是否删除"+$scope.stus[$index].name)){
$scope.stus.splice($index,1);
}
}
}

$scope.fh = function(){
var plsc = [];
for(var i=0; i<$scope.stus.length; i++){
if($scope.stus[i].ck){
if($scope.stus[i].zt == "未发货"){
plsc.push($scope.stus[i].zt);
$scope.stus[i].zt="已发货";
}else{
plsc.push($scope.stus[i].zt);
}
}
}
if(plsc.length == 0){
alert("请选择")
}
}

$scope.yue=function(m){
var currentd=m.getMonth()+1; //0-11
//获取开始日期
var start=$scope.selmonth1;
//获取结束月份
var end=$scope.selmonth2;
if(start==undefined&&end==undefined){
return true;
}
else if(currentd>=start&&currentd<=end){
return true;
}
return false;
}
});
</script>

<style>
.box{
width: 1400px;
height: 600px;
margin: 0 auto;
border: solid 2px red;
}
.box select{
width: 80px;
height: 23px;
margin-top: 10px;
margin-bottom: 10px;
}
#but1{
background: pink;
}
#but2{
background: plum;
}
#but3{
background: palevioletred;
}
table{
width: 1400px;
margin-top: 10px;
text-align: center;
}
tr:nth-child(odd){
background: yellow;
}
tr:nth-child(even){
background: greenyellow;
}
</style>
</head>
<body ng-app="Lj" ng-controller="cont">
<div class="box">
<input type="text" placeholder="用户名搜索" ng-model="selname"/>
<input type="text" placeholder="手机号搜索" ng-model="seltel"/>
<select ng-model="selcity">
<option ng-selected="true">选择城市</option>
<option>北京</option>
<option>上海</option>
<option>重庆</option>
<option>天津</option>
</select>
<select ng-model="selzt">
<option ng-selected="true">选择状态</option>
<option>已发货</option>
<option>未发货</option>
</select>
<select ng-model="selmonth1">
<option ng-selected="true">开始月份</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>-
<select ng-model="selmonth2">
<option ng-selected="true">结束月份</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<select ng-model="px">
<option ng-selected="true">ID排序</option>
<option value="-id">ID降序</option>
<option value="+id">ID升序</option>
</select><br />
<input type="button" value="新增用户" id="but1" ng-click="formShow = true"/>
<input type="button" value="批量发货" id="but3" ng-click="fh()"/>
<input type="button" value="批量删除" id="but2" ng-click="dele()"/>
<span >敏感词:抢劫,小偷</span>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" ng-click="ckAll()" ng-model="flag"/></td>
<td>ID</td>
<td>商品名</td>
<td>用户名</td>
<td>手机号</td>
<td>价格</td>
<td>城市</td>
<td>下单时间</td>
<td>状态</td>
<td>操作</td>
</tr>
<tr ng-repeat="s in stus|filter:{name:selname}|filter:{level:sellevel}|orderBy:px|
filter:{city:selcity}|filter:{zt:selzt}|filter:{tel:seltel}" ng-show="yue(g.regdate)">
<td><input type="checkbox" ng-model="s.ck"/></td>
<td>{{s.id}}</td>
<td>{{s.shopname}}
<span  ng-show="f">
<input  ng-model="s.shopname" />
</span>
</td>
<td>{{s.name}}
<span  ng-show="f">
<input  ng-model="s.name" />
</span>
</td>
<td>{{s.tel}}
<span  ng-show="f">
<input  ng-model="s.tel" />
</span>
</td>
<td>{{s.money|currency:"¥"}}
<span  ng-show="f">
<input  ng-model="s.money" />
</span>
<!--</td>-->
<td>{{s.city}}
<span  ng-show="f">
<input  ng-model="s.city" />
</span>
</td>
<td>{{s.regdate|date:"yyyy-MM-dd hh:mm:ss"}}
<span  ng-show="f">
<input  ng-model="s.regdate" />
</span>
</td>
<td>
<a href="" ng-show="s.zt=='未发货'" ng-click="s.zt='已发货'" class="aaa">发货</a>
<span ng-show="s.zt == '已发货'">{{s.zt}}</span>
<span  ng-show="f">
<input  ng-model="s.zt" />
</span>
</td>
<td>
<input type="button" value="修改" ng-click="f=true" style="background: red;"/>
<span  ng-show="f"> <button  ng-click="f=false" style="background: yellow;">保存</button></span>
<input type="button" value="删除" ng-click="delete($index)" style="background: red;"/>
</td>
</tr>
</table>
<form style="border: 2px solid red; width: 300px; margin: 10px auto;" ng-show="formShow">
<h3>添加商品</h3>
商品id:<input type="text" placeholder="商品id" ng-model="newid"/><br />
商品名称:<input type="text" placeholder="商品名称" ng-model="newname"/><br />
用户名:<input type="text" placeholder="用户名" ng-model="newhname"/><br />
手机号:<input type="text" placeholder="手机号" ng-model="newtel"/><br />
价格:<input type="text" placeholder="价格" ng-model="newprice"/><br />
城市:<input type="text" placeholder="城市" ng-model="newcity"/><br />
状态:<input type="text" placeholder="状态" ng-model="newtype"/><br />
<div style="border: 1px solid blueviolet; width: 250px;background-color: plum;"ng-show="divShow">
<ul>
<li ng-repeat="chenk in checkSub">{{chenk}}</li>
</ul>
</div><br />
<input type="button" value="添加" ng-click="sub()"/>
</form>
</div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
假设订单表名为`orders`,包含以下字段:`id` (订单ID)、`status` (订单状态)、`delivery_time` (发货时间)。其中,订单状态为1表示已发货,为0表示发货。 以下是Java代码实现: ```java import java.sql.*; import java.time.LocalDate; public class OrderStatistics { public static void main(String[] args) { String url = "jdbc:mysql://localhost:3306/test?useSSL=false&serverTimezone=UTC"; String user = "root"; String password = "123456"; Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { // 连接数据库 conn = DriverManager.getConnection(url, user, password); // 查询今日已发货数量 String deliveredSql = "SELECT COUNT(*) FROM orders WHERE status = 1 AND delivery_time = ?"; ps = conn.prepareStatement(deliveredSql); ps.setDate(1, Date.valueOf(LocalDate.now())); rs = ps.executeQuery(); if (rs.next()) { int deliveredCount = rs.getInt(1); System.out.println("今日已发货数量:" + deliveredCount); } // 查询今日发货数量 String undeliveredSql = "SELECT COUNT(*) FROM orders WHERE status = 0 AND delivery_time = ?"; ps = conn.prepareStatement(undeliveredSql); ps.setDate(1, Date.valueOf(LocalDate.now())); rs = ps.executeQuery(); if (rs.next()) { int undeliveredCount = rs.getInt(1); System.out.println("今日发货数量:" + undeliveredCount); } } catch (SQLException e) { e.printStackTrace(); } finally { try { if (rs != null) rs.close(); if (ps != null) ps.close(); if (conn != null) conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } } ``` 在代码中,使用`java.sql`包中的`Connection`、`PreparedStatement`和`ResultSet`等类来进行数据库操作。首先建立数据库连接,然后分别执行查询已发货发货数量的SQL语句,将当前日期作为参数传递给`PreparedStatement`对象。最后关闭连接和相关对象。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值