├── web ├── META-INF │ └── MANIFEST.MF ├── img │ ├── p1.png │ ├── p2.png │ ├── p3.png │ ├── p4.png │ ├── p5.png │ ├── p6.png │ ├── p7.png │ ├── p8.png │ ├── timg.jpg │ ├── logo.jpeg │ ├── logon.jpg │ ├── carousel01.jfif │ ├── carousel02.jfif │ └── f0554d758828564268b739662ecc1525.jpg ├── WEB-INF │ ├── lib │ │ ├── JavaMD5.jar │ │ ├── jstl-1.2.jar │ │ ├── log4j-1.2.12.jar │ │ ├── mybatis-3.4.6.jar │ │ ├── jsqlparser-1.0.jar │ │ ├── pagehelper-5.1.4.jar │ │ ├── jackson-core-2.9.6.jar │ │ ├── aspectjweaver-1.9.1.jar │ │ ├── commons-dbcp2-2.2.0.jar │ │ ├── commons-logging-1.2.jar │ │ ├── commons-pool2-2.5.0.jar │ │ ├── mybatis-spring-1.3.2.jar │ │ ├── jackson-databind-2.9.6.jar │ │ ├── spring-tx-5.0.5.RELEASE.jar │ │ ├── jackson-annotations-2.9.6.jar │ │ ├── spring-aop-5.0.5.RELEASE.jar │ │ ├── spring-beans-5.0.5.RELEASE.jar │ │ ├── spring-core-5.0.5.RELEASE.jar │ │ ├── spring-jcl-5.0.5.RELEASE.jar │ │ ├── spring-jdbc-5.0.5.RELEASE.jar │ │ ├── spring-web-5.0.5.RELEASE.jar │ │ ├── mysql-connector-java-5.1.46.jar │ │ ├── spring-context-5.0.5.RELEASE.jar │ │ ├── spring-webmvc-5.0.5.RELEASE.jar │ │ └── spring-expression-5.0.5.RELEASE.jar │ ├── web.xml │ └── pages │ │ ├── 404.jsp │ │ ├── about.jsp │ │ ├── login.jsp │ │ ├── newsContent.jsp │ │ └── batchmanager.jsp ├── layui │ ├── font │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ ├── images │ │ └── face │ │ │ ├── 0.gif │ │ │ ├── 1.gif │ │ │ ├── 10.gif │ │ │ ├── 11.gif │ │ │ ├── 12.gif │ │ │ ├── 13.gif │ │ │ ├── 14.gif │ │ │ ├── 15.gif │ │ │ ├── 16.gif │ │ │ ├── 17.gif │ │ │ ├── 18.gif │ │ │ ├── 19.gif │ │ │ ├── 2.gif │ │ │ ├── 20.gif │ │ │ ├── 21.gif │ │ │ ├── 22.gif │ │ │ ├── 23.gif │ │ │ ├── 24.gif │ │ │ ├── 25.gif │ │ │ ├── 26.gif │ │ │ ├── 27.gif │ │ │ ├── 28.gif │ │ │ ├── 29.gif │ │ │ ├── 3.gif │ │ │ ├── 30.gif │ │ │ ├── 31.gif │ │ │ ├── 32.gif │ │ │ ├── 33.gif │ │ │ ├── 34.gif │ │ │ ├── 35.gif │ │ │ ├── 36.gif │ │ │ ├── 37.gif │ │ │ ├── 38.gif │ │ │ ├── 39.gif │ │ │ ├── 4.gif │ │ │ ├── 40.gif │ │ │ ├── 41.gif │ │ │ ├── 42.gif │ │ │ ├── 43.gif │ │ │ ├── 44.gif │ │ │ ├── 45.gif │ │ │ ├── 46.gif │ │ │ ├── 47.gif │ │ │ ├── 48.gif │ │ │ ├── 49.gif │ │ │ ├── 5.gif │ │ │ ├── 50.gif │ │ │ ├── 51.gif │ │ │ ├── 52.gif │ │ │ ├── 53.gif │ │ │ ├── 54.gif │ │ │ ├── 55.gif │ │ │ ├── 56.gif │ │ │ ├── 57.gif │ │ │ ├── 58.gif │ │ │ ├── 59.gif │ │ │ ├── 6.gif │ │ │ ├── 60.gif │ │ │ ├── 61.gif │ │ │ ├── 62.gif │ │ │ ├── 63.gif │ │ │ ├── 64.gif │ │ │ ├── 65.gif │ │ │ ├── 66.gif │ │ │ ├── 67.gif │ │ │ ├── 68.gif │ │ │ ├── 69.gif │ │ │ ├── 7.gif │ │ │ ├── 70.gif │ │ │ ├── 71.gif │ │ │ ├── 8.gif │ │ │ └── 9.gif │ ├── css │ │ └── modules │ │ │ ├── layer │ │ │ └── default │ │ │ │ ├── icon.png │ │ │ │ ├── icon-ext.png │ │ │ │ ├── loading-0.gif │ │ │ │ ├── loading-1.gif │ │ │ │ └── loading-2.gif │ │ │ └── code.css │ └── lay │ │ └── modules │ │ ├── code.js │ │ ├── laytpl.js │ │ ├── flow.js │ │ ├── rate.js │ │ ├── tree.js │ │ ├── util.js │ │ ├── carousel.js │ │ └── laypage.js ├── index.jsp ├── js │ ├── 404.js │ ├── signin.js │ └── count.js └── css │ ├── global.css │ └── 404.css ├── .gitattributes ├── .idea ├── dictionaries │ └── stark.xml ├── codeStyles │ └── codeStyleConfig.xml ├── encodings.xml ├── modules.xml ├── misc.xml ├── dataSources.local.xml ├── dataSources.xml ├── inspectionProfiles │ └── Project_Default.xml └── artifacts │ └── pighelper_war_exploded.xml ├── .gitignore ├── src ├── log4j.properties ├── com │ └── y1ang │ │ ├── dao │ │ ├── UserMapper.java │ │ ├── FeedMapper.java │ │ ├── OtherMapper.java │ │ ├── BuyMapper.java │ │ ├── SaleMapper.java │ │ ├── VaccineMapper.java │ │ ├── BatchMapper.java │ │ └── CountMapper.java │ │ ├── service │ │ ├── IUserService.java │ │ ├── IOtherService.java │ │ ├── IBuyService.java │ │ ├── impl │ │ │ ├── IUserServiceImpl.java │ │ │ ├── IFeedServiceImpl.java │ │ │ ├── IOtherServiceImpl.java │ │ │ ├── ISaleServiceImpl.java │ │ │ ├── IVaccineServiceImpl.java │ │ │ ├── IBuyServiceImpl.java │ │ │ ├── IBatchServiceImpl.java │ │ │ └── ICountServiceImpl.java │ │ ├── IVaccineService.java │ │ ├── IFeedService.java │ │ ├── ISaleService.java │ │ ├── IBatchService.java │ │ └── ICountService.java │ │ ├── entity │ │ ├── Page.java │ │ ├── FeedJson.java │ │ ├── SaleJson.java │ │ ├── PriceJson.java │ │ ├── BatchJson.java │ │ ├── Prices.java │ │ ├── OtherJson.java │ │ ├── ProfitAndLoss.java │ │ ├── Batch.java │ │ ├── BuyJson.java │ │ ├── VaccineJson.java │ │ ├── Vaccine.java │ │ ├── Feed.java │ │ ├── User.java │ │ ├── Other.java │ │ ├── Buy.java │ │ └── Sale.java │ │ ├── controller │ │ ├── PigPriceController.java │ │ ├── NewsController.java │ │ ├── UserController.java │ │ ├── OtherController.java │ │ ├── PigletController.java │ │ ├── VaccineController.java │ │ ├── CountController.java │ │ └── FeedController.java │ │ ├── mapper │ │ ├── UserMapper.xml │ │ ├── BatchMapper.xml │ │ ├── OtherMapper.xml │ │ ├── FeedMapper.xml │ │ ├── VaccineMapper.xml │ │ ├── BuyMapper.xml │ │ ├── SaleMapper.xml │ │ └── CountMapper.xml │ │ ├── interceptor │ │ └── LoginInterceptor.java │ │ └── util │ │ └── GetNewsUtil.java └── config │ ├── spring-mvc.xml │ └── beans.xml └── README.md /web/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /web/img/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p1.png -------------------------------------------------------------------------------- /web/img/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p2.png -------------------------------------------------------------------------------- /web/img/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p3.png -------------------------------------------------------------------------------- /web/img/p4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p4.png -------------------------------------------------------------------------------- /web/img/p5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p5.png -------------------------------------------------------------------------------- /web/img/p6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p6.png -------------------------------------------------------------------------------- /web/img/p7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p7.png -------------------------------------------------------------------------------- /web/img/p8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/p8.png -------------------------------------------------------------------------------- /web/img/timg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/timg.jpg -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /web/img/logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/logo.jpeg -------------------------------------------------------------------------------- /web/img/logon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/logon.jpg -------------------------------------------------------------------------------- /web/img/carousel01.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/carousel01.jfif -------------------------------------------------------------------------------- /web/img/carousel02.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/carousel02.jfif -------------------------------------------------------------------------------- /web/WEB-INF/lib/JavaMD5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/JavaMD5.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /web/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/font/iconfont.eot -------------------------------------------------------------------------------- /web/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /web/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/font/iconfont.woff -------------------------------------------------------------------------------- /web/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/0.gif -------------------------------------------------------------------------------- /web/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/1.gif -------------------------------------------------------------------------------- /web/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/10.gif -------------------------------------------------------------------------------- /web/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/11.gif -------------------------------------------------------------------------------- /web/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/12.gif -------------------------------------------------------------------------------- /web/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/13.gif -------------------------------------------------------------------------------- /web/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/14.gif -------------------------------------------------------------------------------- /web/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/15.gif -------------------------------------------------------------------------------- /web/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/16.gif -------------------------------------------------------------------------------- /web/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/17.gif -------------------------------------------------------------------------------- /web/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/18.gif -------------------------------------------------------------------------------- /web/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/19.gif -------------------------------------------------------------------------------- /web/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/2.gif -------------------------------------------------------------------------------- /web/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/20.gif -------------------------------------------------------------------------------- /web/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/21.gif -------------------------------------------------------------------------------- /web/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/22.gif -------------------------------------------------------------------------------- /web/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/23.gif -------------------------------------------------------------------------------- /web/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/24.gif -------------------------------------------------------------------------------- /web/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/25.gif -------------------------------------------------------------------------------- /web/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/26.gif -------------------------------------------------------------------------------- /web/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/27.gif -------------------------------------------------------------------------------- /web/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/28.gif -------------------------------------------------------------------------------- /web/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/29.gif -------------------------------------------------------------------------------- /web/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/3.gif -------------------------------------------------------------------------------- /web/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/30.gif -------------------------------------------------------------------------------- /web/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/31.gif -------------------------------------------------------------------------------- /web/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/32.gif -------------------------------------------------------------------------------- /web/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/33.gif -------------------------------------------------------------------------------- /web/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/34.gif -------------------------------------------------------------------------------- /web/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/35.gif -------------------------------------------------------------------------------- /web/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/36.gif -------------------------------------------------------------------------------- /web/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/37.gif -------------------------------------------------------------------------------- /web/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/38.gif -------------------------------------------------------------------------------- /web/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/39.gif -------------------------------------------------------------------------------- /web/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/4.gif -------------------------------------------------------------------------------- /web/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/40.gif -------------------------------------------------------------------------------- /web/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/41.gif -------------------------------------------------------------------------------- /web/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/42.gif -------------------------------------------------------------------------------- /web/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/43.gif -------------------------------------------------------------------------------- /web/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/44.gif -------------------------------------------------------------------------------- /web/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/45.gif -------------------------------------------------------------------------------- /web/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/46.gif -------------------------------------------------------------------------------- /web/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/47.gif -------------------------------------------------------------------------------- /web/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/48.gif -------------------------------------------------------------------------------- /web/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/49.gif -------------------------------------------------------------------------------- /web/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/5.gif -------------------------------------------------------------------------------- /web/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/50.gif -------------------------------------------------------------------------------- /web/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/51.gif -------------------------------------------------------------------------------- /web/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/52.gif -------------------------------------------------------------------------------- /web/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/53.gif -------------------------------------------------------------------------------- /web/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/54.gif -------------------------------------------------------------------------------- /web/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/55.gif -------------------------------------------------------------------------------- /web/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/56.gif -------------------------------------------------------------------------------- /web/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/57.gif -------------------------------------------------------------------------------- /web/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/58.gif -------------------------------------------------------------------------------- /web/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/59.gif -------------------------------------------------------------------------------- /web/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/6.gif -------------------------------------------------------------------------------- /web/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/60.gif -------------------------------------------------------------------------------- /web/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/61.gif -------------------------------------------------------------------------------- /web/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/62.gif -------------------------------------------------------------------------------- /web/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/63.gif -------------------------------------------------------------------------------- /web/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/64.gif -------------------------------------------------------------------------------- /web/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/65.gif -------------------------------------------------------------------------------- /web/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/66.gif -------------------------------------------------------------------------------- /web/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/67.gif -------------------------------------------------------------------------------- /web/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/68.gif -------------------------------------------------------------------------------- /web/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/69.gif -------------------------------------------------------------------------------- /web/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/7.gif -------------------------------------------------------------------------------- /web/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/70.gif -------------------------------------------------------------------------------- /web/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/71.gif -------------------------------------------------------------------------------- /web/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/8.gif -------------------------------------------------------------------------------- /web/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/images/face/9.gif -------------------------------------------------------------------------------- /web/WEB-INF/lib/log4j-1.2.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/log4j-1.2.12.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/mybatis-3.4.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/mybatis-3.4.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/jsqlparser-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/jsqlparser-1.0.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/pagehelper-5.1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/pagehelper-5.1.4.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/jackson-core-2.9.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/jackson-core-2.9.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/aspectjweaver-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/aspectjweaver-1.9.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-dbcp2-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/commons-dbcp2-2.2.0.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-pool2-2.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/commons-pool2-2.5.0.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/mybatis-spring-1.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/mybatis-spring-1.3.2.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/jackson-databind-2.9.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/jackson-databind-2.9.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-tx-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-tx-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/jackson-annotations-2.9.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/jackson-annotations-2.9.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-aop-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-aop-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-beans-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-beans-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-core-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-core-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-jcl-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-jcl-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-jdbc-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-jdbc-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-web-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-web-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/img/f0554d758828564268b739662ecc1525.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/img/f0554d758828564268b739662ecc1525.jpg -------------------------------------------------------------------------------- /web/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /web/WEB-INF/lib/mysql-connector-java-5.1.46.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/mysql-connector-java-5.1.46.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-context-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-context-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-webmvc-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-webmvc-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /web/WEB-INF/lib/spring-expression-5.0.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/WEB-INF/lib/spring-expression-5.0.5.RELEASE.jar -------------------------------------------------------------------------------- /web/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /web/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /web/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chriy/pighelper/HEAD/web/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /.idea/dictionaries/stark.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | layui 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | .idea/ 11 | out/ 12 | pighelper.iml 13 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 14 | hs_err_pid* 15 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger = debug , stdout 2 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.Target = System.out 4 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n -------------------------------------------------------------------------------- /web/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: y1ang 4 | Date: 2018.10.18 5 | Time: 16:50 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/com/y1ang/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import com.y1ang.entity.User; 4 | 5 | /** 6 | * @author y1ang 7 | * @Data 2018年10月13日-上午10:31:04 8 | * @Description 用户登录接口类 9 | */ 10 | public interface UserMapper { 11 | 12 | /** 13 | * 登录 14 | * 15 | * @param user 16 | * @return 17 | */ 18 | public User login(User user); 19 | 20 | /** 21 | * 查询用户 22 | * 23 | * @param userID 24 | * @return 25 | */ 26 | public User findUser(int userID); 27 | 28 | /** 29 | * 检查原密码是否正确 30 | * 31 | * @param user 32 | * @return 33 | */ 34 | public User checkOldPwd(User user); 35 | 36 | /** 37 | * 更新密码 38 | * 39 | * @param user 40 | * @return 41 | */ 42 | public int updatePwd(User user); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/com/y1ang/service/IUserService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import com.y1ang.entity.User; 4 | 5 | /** 6 | * @author y1ang 7 | * @Data 2018年10月13日-上午10:49:49 8 | * @Description 用户服务层接口类 9 | */ 10 | public interface IUserService { 11 | /** 12 | * 登录 13 | * 14 | * @param user 15 | * @return 16 | */ 17 | public User login(User user); 18 | 19 | /** 20 | * 查询用户 21 | * 22 | * @param userID 23 | * @return 24 | */ 25 | public User findUser(int userID); 26 | 27 | /** 28 | * 检查原密码是否正确 29 | * 30 | * @param user 31 | * @return 32 | */ 33 | public User checkOldPwd(User user); 34 | 35 | /** 36 | * 更新密码 37 | * 38 | * @param user 39 | * @return 40 | */ 41 | public int updatePwd(User user); 42 | } 43 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Page.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * 5 | * @author y1ang 6 | * @Data 2018年10月13日-上午10:36:30 7 | * @Description 分页POJO类 8 | */ 9 | public class Page { 10 | 11 | private Integer page; 12 | 13 | private Integer limit; 14 | 15 | public Integer getPage() { 16 | return page; 17 | } 18 | 19 | public void setPage(Integer page) { 20 | this.page = page; 21 | } 22 | 23 | public Integer getLimit() { 24 | return limit; 25 | } 26 | 27 | public void setLimit(Integer limit) { 28 | this.limit = limit; 29 | } 30 | 31 | public Page(Integer page, Integer limit) { 32 | super(); 33 | this.page = page; 34 | this.limit = limit; 35 | } 36 | 37 | public Page() { 38 | super(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /.idea/dataSources.local.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #@ 7 | ` 8 | 9 | 10 | master_key 11 | root 12 | *:@ 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/FeedJson.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.List; 4 | /** 5 | * 6 | * @author y1ang 7 | * @Data 2018年10月13日-上午10:34:24 8 | * @Description 饲料账单JSON数据POJO类 9 | */ 10 | public class FeedJson { 11 | private int code; 12 | 13 | private String msg; 14 | 15 | private int count; 16 | 17 | private List data; 18 | 19 | public int getCode() { 20 | return code; 21 | } 22 | 23 | public void setCode(int code) { 24 | this.code = code; 25 | } 26 | 27 | public String getMsg() { 28 | return msg; 29 | } 30 | 31 | public void setMsg(String msg) { 32 | this.msg = msg; 33 | } 34 | 35 | public int getCount() { 36 | return count; 37 | } 38 | 39 | public void setCount(int count) { 40 | this.count = count; 41 | } 42 | 43 | public List getData() { 44 | return data; 45 | } 46 | 47 | public void setData(List data) { 48 | this.data = data; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql 6 | true 7 | com.mysql.jdbc.Driver 8 | jdbc:mysql://localhost:3306/pighelper 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /web/js/404.js: -------------------------------------------------------------------------------- 1 | function randomNum() { 2 | return Math.floor(Math.random() * 9) + 1; 3 | } 4 | var loop1, loop2, loop3, 5 | time = 30, i = 0, number; 6 | loop3 = setInterval(function () { 7 | if (i > 40) { 8 | clearInterval(loop3); 9 | document.querySelector('.thirdDigit').textContent = 4; 10 | } else { 11 | document.querySelector('.thirdDigit').textContent = randomNum(); 12 | i++; 13 | } 14 | }, time); 15 | loop2 = setInterval(function () { 16 | if (i > 80) { 17 | clearInterval(loop2); 18 | document.querySelector('.secondDigit').textContent = 0; 19 | } else { 20 | document.querySelector('.secondDigit').textContent = randomNum(); 21 | i++; 22 | } 23 | }, time); 24 | loop1 = setInterval(function () { 25 | if (i > 100) { 26 | clearInterval(loop1); 27 | document.querySelector('.firstDigit').textContent = 4; 28 | } else { 29 | document.querySelector('.firstDigit').textContent = randomNum(); 30 | i++; 31 | } 32 | }, time); -------------------------------------------------------------------------------- /src/com/y1ang/entity/SaleJson.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 7 | * @author y1ang 8 | * @Data 2018年10月15日-下午3:46:01 9 | * @Description 卖猪账单JSON数据POJO类 10 | */ 11 | public class SaleJson { 12 | 13 | private int code; 14 | 15 | private String msg; 16 | 17 | private int count; 18 | 19 | private List data; 20 | 21 | public int getCode() { 22 | return code; 23 | } 24 | 25 | public void setCode(int code) { 26 | this.code = code; 27 | } 28 | 29 | public String getMsg() { 30 | return msg; 31 | } 32 | 33 | public void setMsg(String msg) { 34 | this.msg = msg; 35 | } 36 | 37 | public int getCount() { 38 | return count; 39 | } 40 | 41 | public void setCount(int count) { 42 | this.count = count; 43 | } 44 | 45 | public List getData() { 46 | return data; 47 | } 48 | 49 | public void setData(List data) { 50 | this.data = data; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/PriceJson.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 7 | * @author y1ang 8 | * @Data 2018年10月13日-上午10:36:50 9 | * @Description 猪价JSON数据POJO类 10 | */ 11 | public class PriceJson { 12 | 13 | private int code; 14 | 15 | private String msg; 16 | 17 | private int count; 18 | 19 | private List data; 20 | 21 | public int getCode() { 22 | return code; 23 | } 24 | 25 | public void setCode(int code) { 26 | this.code = code; 27 | } 28 | 29 | public String getMsg() { 30 | return msg; 31 | } 32 | 33 | public void setMsg(String msg) { 34 | this.msg = msg; 35 | } 36 | 37 | public int getCount() { 38 | return count; 39 | } 40 | 41 | public void setCount(int count) { 42 | this.count = count; 43 | } 44 | 45 | public List getData() { 46 | return data; 47 | } 48 | 49 | public void setData(List data) { 50 | this.data = data; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /web/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /src/com/y1ang/dao/FeedMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Feed; 6 | import com.y1ang.entity.Page; 7 | /** 8 | * @author y1ang 9 | * @Data 2018年10月13日-上午10:30:16 10 | * @Description 饲料账单操作接口类 11 | */ 12 | public interface FeedMapper { 13 | 14 | /** 15 | * 查询当前批次下所有饲料记录 16 | * @param page 17 | * @return 18 | */ 19 | public List findFeedRecord(Page page); 20 | /** 21 | * 通过id查询饲料账单 22 | * @param feedID 23 | * @return 24 | * 25 | */ 26 | public Feed findFeedRecordByID(int feedID); 27 | /** 28 | * 添加饲料账单记录 29 | * @param feed 30 | * @return 31 | */ 32 | public int addFeedRecord(Feed feed); 33 | /** 34 | * 更新饲料账单 35 | * @param feed 36 | * @return 37 | */ 38 | public int updateFeedRecord(Feed feed); 39 | /** 40 | * 删除饲料账单 41 | * @param feedID 42 | * @return 43 | */ 44 | public int deleteFeedRecord(int feedID); 45 | /** 46 | * 查询饲料账单的记录总数 47 | * @param batchNumber 48 | * @return 49 | */ 50 | public int getFeedCount(int batchNumber); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/com/y1ang/dao/OtherMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Other; 6 | import com.y1ang.entity.Page; 7 | /** 8 | * 9 | * @author y1ang 10 | * @Data 2018年10月13日-上午10:30:42 11 | * @Description 其他账单操作接口类 12 | */ 13 | public interface OtherMapper { 14 | 15 | /** 16 | * 查询所有其他记录信息 17 | * @param page 18 | * @return 19 | */ 20 | public List findAllOtherRecord(Page page); 21 | /** 22 | * 添加其他记录 23 | * @param other 24 | * @return 25 | */ 26 | public int addOtherRecord(Other other); 27 | 28 | /** 29 | * 更新其他记录 30 | * @param other 31 | * @return 32 | */ 33 | public int updateOtherRecord(Other other); 34 | 35 | /** 36 | * 删除其他记录 37 | * @param recordID 38 | * @return 39 | */ 40 | public int deleteOtherRecord(int recordID); 41 | /** 42 | * 通过ID查询其他记录 43 | * @param recordID 44 | * @return 45 | */ 46 | public Other findOtherRecordByID(int recordID); 47 | 48 | /** 49 | * 查询其他记录总数 50 | * @param batchNumber 51 | * @return 52 | */ 53 | public int getOtherCount(int batchNumber); 54 | } 55 | -------------------------------------------------------------------------------- /src/com/y1ang/service/IOtherService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Other; 6 | import com.y1ang.entity.Page; 7 | 8 | /** 9 | * 10 | * @author y1ang 11 | * @Data 2018年10月13日-上午10:49:05 12 | * @Description 其他账单服务层接口类 13 | */ 14 | public interface IOtherService { 15 | 16 | /** 17 | * 查询所有其他记录信息 18 | * @param page 19 | * @return 20 | */ 21 | public List findAllOtherRecord(Page page); 22 | /** 23 | * 添加其他记录 24 | * @param other 25 | * @return 26 | */ 27 | public int addOtherRecord(Other other); 28 | 29 | /** 30 | * 更新其他记录 31 | * @param other 32 | * @return 33 | */ 34 | public int updateOtherRecord(Other other); 35 | 36 | /** 37 | * 删除其他记录 38 | * @param recordID 39 | * @return 40 | */ 41 | public int deleteOtherRecord(int recordID); 42 | /** 43 | * 通过ID查询其他记录 44 | * @param recordID 45 | * @return 46 | */ 47 | public Other findOtherRecordByID(int recordID); 48 | 49 | /** 50 | * 查询其他记录总数 51 | * @param batchNumber 52 | * @return 53 | */ 54 | public int getOtherCount(int batchNumber); 55 | } 56 | -------------------------------------------------------------------------------- /src/com/y1ang/dao/BuyMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Buy; 6 | import com.y1ang.entity.Page; 7 | 8 | /** 9 | * @Author y1ang 10 | * @Data 2018年10月17日-下午4:47:05 11 | * @Description 购买账单接口类 12 | */ 13 | public interface BuyMapper { 14 | 15 | /** 16 | * 查询所有购买账单 17 | * 18 | * @param page 19 | * @return 20 | */ 21 | public List findAllBuyRecord(Page page); 22 | 23 | /** 24 | * 通过id查询购买账单信息 25 | * 26 | * @param buyID 27 | * @return 28 | */ 29 | public Buy findBuyRecordByID(int buyID); 30 | 31 | /** 32 | * 添加购买幼猪账单信息 33 | * 34 | * @param buy 35 | * @return 36 | */ 37 | public int addBuyRecord(Buy buy); 38 | 39 | /** 40 | * 更新购买幼猪账单信息 41 | * @param buy 42 | * @return 43 | */ 44 | public int updateBuyRecord(Buy buy); 45 | 46 | /** 47 | * 删除购买幼猪账单信息 48 | * @param buyID 49 | * @return 50 | */ 51 | public int deleteBuyRecord(int buyID); 52 | 53 | /** 54 | * 获取当前批次账单总数 55 | * @return 56 | */ 57 | public int getBuyCount(); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /web/layui/lay/modules/code.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /src/com/y1ang/service/IBuyService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import com.y1ang.entity.Buy; 4 | import com.y1ang.entity.Page; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author y1ang 10 | * @date 2018年10月18日-下午4:47:05 11 | * @descr 购买幼猪账单操作服务类 12 | */ 13 | public interface IBuyService { 14 | 15 | /** 16 | * 查询所有购买账单 17 | * 18 | * @param page 19 | * @return 20 | */ 21 | public List findAllBuyRecord(Page page); 22 | 23 | /** 24 | * 通过id查询购买账单信息 25 | * 26 | * @param buyID 27 | * @return 28 | */ 29 | public Buy findBuyRecordByID(int buyID); 30 | 31 | /** 32 | * 添加购买幼猪账单信息 33 | * 34 | * @param buy 35 | * @return 36 | */ 37 | public int addBuyRecord(Buy buy); 38 | 39 | /** 40 | * 更新购买幼猪账单信息 41 | * @param buy 42 | * @return 43 | */ 44 | public int updateBuyRecord(Buy buy); 45 | 46 | /** 47 | * 删除购买幼猪账单信息 48 | * @param buyID 49 | * @return 50 | */ 51 | public int deleteBuyRecord(int buyID); 52 | 53 | /** 54 | * 获取当前批次账单总数 55 | * @return 56 | */ 57 | public int getBuyCount(); 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 基于Hybrid+SSM的养猪信息化平台。 2 | **从养殖户的角度来看,获取养殖新闻的途径可能有很多,** 3 | **但是由于新闻不集中,功能不齐全,并没有那么方便。** 4 | **该项目旨在帮助养殖户获取时事新闻,猪价信息。统计开销,画图展示,数据可视化等。** 5 | **最终打包成混合式App安装在移动端,简化用户使用** 6 | 7 | 8 | 9 | --- 10 | 11 | 12 | 13 | ### 注意事项: 14 | 15 | **爬虫文件全部写在util包底下。网站的url地址可能会发生变化。如果爬虫失效,请检查各个链接地址是否可用** 16 | 17 | ```java 18 | /** 19 | * 获取标题和URL 20 | * @return 21 | */ 22 | public static List> getItem() { 23 | String reqUrl = "https://www.zhuwang.cc/";//首页新闻地址 24 | String resource = GetNewsUtil.getSources(reqUrl);//获取网页源代码 25 | .... 26 | ``` 27 | 28 | 29 | 30 | --- 31 | 32 | 33 | 34 | ### 1、用户登录模块。权限控制 35 | 36 | ![image](/web/img/p1.png) 37 | 38 | ### 2、爬虫获取新闻数据展示模块。这个模块实现对网络数据的实时获取 39 | 40 | ![image](/web/img/p1.png) 41 | 42 | ### 3、猪价获取模块,这个功能模块是获取每日猪价信息 43 | 44 | ![image](/web/img/p4.png) 45 | 46 | ### 4、统计功能模块。这个模块实现了对各类账单的数据统计和数据可视化展示 47 | 48 | ![image](/web/img/p3.png) 49 | 50 | ### 5、设置模块,这个功能模块实现的是对整个系统的设置 51 | 52 | ![image](/web/img/p5.png) 53 | 54 | ### 6、各类账单数据的增删改查功能 55 | 56 | ![image](/web/img/p6.png) 57 | ![image](/web/img/p7.png) 58 | ![image](/web/img/p8.png) 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/com/y1ang/dao/SaleMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.entity.Sale; 7 | /** 8 | * 9 | * @author y1ang 10 | * @Data 2018年10月15日-下午2:44:11 11 | * @Description 卖猪账单操作接口类 12 | */ 13 | public interface SaleMapper { 14 | 15 | /** 16 | * 查询所有卖猪账单 17 | * @param page 18 | * @return 19 | */ 20 | public List findSaleRecord(Page page); 21 | /** 22 | * 查询改批次下卖猪账单的总记录数 23 | * @param batchNumber 24 | * @return 25 | */ 26 | public int getSaleCount(int batchNumber); 27 | /** 28 | * 通过ID查询卖猪账单信息 29 | * @param saleID 30 | * @return 31 | */ 32 | public Sale finSaleRecordByID(int saleID); 33 | /** 34 | * 插入卖猪账单 35 | * @param sale 36 | * @return 37 | */ 38 | public int insertSaleRecord(Sale sale); 39 | /** 40 | * 更新卖猪账单 41 | * @param sale 42 | * @return 43 | */ 44 | public int updateSaleRecord(Sale sale); 45 | 46 | /** 47 | * 删除饲料账单 48 | * @param saleID 49 | * @return 50 | */ 51 | public int deleteSaleRecord(int saleID); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/IUserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import com.y1ang.dao.UserMapper; 4 | import com.y1ang.entity.User; 5 | import com.y1ang.service.IUserService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * @author y1ang 11 | * @Data 2018年10月13日-上午10:27:39 12 | * @Description 用户操作服务层实现类 13 | */ 14 | @Service 15 | public class IUserServiceImpl implements IUserService{ 16 | 17 | @Autowired 18 | private UserMapper dao; 19 | 20 | @Override 21 | public User login(User user) { 22 | return dao.login(user); 23 | } 24 | 25 | /** 26 | * 查询用户 27 | * 28 | * @return 29 | */ 30 | @Override 31 | public User findUser(int useID) { 32 | return dao.findUser(useID); 33 | } 34 | 35 | /** 36 | * 检查原密码是否正确 37 | * 38 | * @param user 39 | * @return 40 | */ 41 | @Override 42 | public User checkOldPwd(User user) { 43 | return dao.checkOldPwd(user); 44 | } 45 | 46 | /** 47 | * 更新密码 48 | * 49 | * @param user 50 | * @return 51 | */ 52 | @Override 53 | public int updatePwd(User user) { 54 | return dao.updatePwd(user); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/BatchJson.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.List; 4 | /** 5 | * 6 | * @author y1ang 7 | * @Data 2018年10月13日-上午10:31:46 8 | * @Description 批次返回JSON数据POJO类 9 | */ 10 | public class BatchJson { 11 | private int code; 12 | 13 | private String msg; 14 | 15 | private int count; 16 | 17 | private List data; 18 | 19 | public int getCode() { 20 | return code; 21 | } 22 | 23 | public void setCode(int code) { 24 | this.code = code; 25 | } 26 | 27 | public String getMsg() { 28 | return msg; 29 | } 30 | 31 | public void setMsg(String msg) { 32 | this.msg = msg; 33 | } 34 | 35 | public int getCount() { 36 | return count; 37 | } 38 | 39 | public void setCount(int count) { 40 | this.count = count; 41 | } 42 | 43 | public List getData() { 44 | return data; 45 | } 46 | 47 | public void setData(List data) { 48 | this.data = data; 49 | } 50 | 51 | public BatchJson(int code, String msg, int count, List data) { 52 | super(); 53 | this.code = code; 54 | this.msg = msg; 55 | this.count = count; 56 | this.data = data; 57 | } 58 | 59 | public BatchJson() { 60 | super(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Prices.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * 5 | * @author y1ang 6 | * @Data 2018年10月13日-上午10:37:20 7 | * @Description 猪价POJO类 8 | */ 9 | public class Prices { 10 | /** 11 | * 猪价城市 12 | */ 13 | private String city; 14 | /** 15 | * 猪价 16 | */ 17 | private String price; 18 | /** 19 | * 猪价趋势(上涨、下跌、平) 20 | */ 21 | private String range; 22 | 23 | public String getCity() { 24 | return city; 25 | } 26 | 27 | public void setCity(String city) { 28 | this.city = city; 29 | } 30 | 31 | public String getPrice() { 32 | return price; 33 | } 34 | 35 | public void setPrice(String price) { 36 | this.price = price; 37 | } 38 | 39 | public String getRange() { 40 | return range; 41 | } 42 | 43 | public void setRange(String range) { 44 | this.range = range; 45 | } 46 | 47 | public Prices(String city, String price, String range) { 48 | super(); 49 | this.city = city; 50 | this.price = price; 51 | this.range = range; 52 | } 53 | 54 | public Prices() { 55 | super(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/OtherJson.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.List; 4 | /** 5 | * 6 | * @author y1ang 7 | * @Data 2018年10月13日-上午10:36:10 8 | * @Description 其他批次JSON数据POJO类 9 | */ 10 | public class OtherJson { 11 | 12 | private int code; 13 | 14 | private String msg; 15 | 16 | private int count; 17 | 18 | private List data; 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | 24 | public void setCode(int code) { 25 | this.code = code; 26 | } 27 | 28 | public String getMsg() { 29 | return msg; 30 | } 31 | 32 | public void setMsg(String msg) { 33 | this.msg = msg; 34 | } 35 | 36 | public int getCount() { 37 | return count; 38 | } 39 | 40 | public void setCount(int count) { 41 | this.count = count; 42 | } 43 | 44 | public List getData() { 45 | return data; 46 | } 47 | 48 | public void setData(List data) { 49 | this.data = data; 50 | } 51 | 52 | public OtherJson(int code, String msg, int count, List data) { 53 | super(); 54 | this.code = code; 55 | this.msg = msg; 56 | this.count = count; 57 | this.data = data; 58 | } 59 | 60 | public OtherJson() { 61 | super(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/ProfitAndLoss.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * @author y1ang 5 | * @Data 2018.10.24 21:40 6 | * @Description 盈亏 7 | */ 8 | public class ProfitAndLoss { 9 | 10 | /** 11 | * 收入 12 | */ 13 | private double income; 14 | /** 15 | * 支出 16 | */ 17 | private double expend; 18 | /** 19 | * 利润 20 | */ 21 | private double profit; 22 | 23 | public double getIncome() { 24 | return income; 25 | } 26 | 27 | public double getExpend() { 28 | return expend; 29 | } 30 | 31 | public double getProfit() { 32 | return profit; 33 | } 34 | 35 | public void setIncome(double income) { 36 | this.income = income; 37 | } 38 | 39 | public void setExpend(double expend) { 40 | this.expend = expend; 41 | } 42 | 43 | public void setProfit(double profit) { 44 | this.profit = profit; 45 | } 46 | 47 | public ProfitAndLoss(double income, double expend, double profit) { 48 | this.income = income; 49 | this.expend = expend; 50 | this.profit = profit; 51 | } 52 | 53 | public ProfitAndLoss() { 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Batch.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | /** 3 | * 4 | * @author y1ang 5 | * @Data 2018年10月13日-上午10:31:26 6 | * @Description 批次POJO类 7 | */ 8 | public class Batch { 9 | private int batchId; 10 | private int batchNumber; 11 | private int batchStatus; 12 | 13 | public int getBatchId() { 14 | return batchId; 15 | } 16 | 17 | public void setBatchId(int batchId) { 18 | this.batchId = batchId; 19 | } 20 | 21 | public int getBatchNumber() { 22 | return batchNumber; 23 | } 24 | 25 | public void setBatchNumber(int batchNumber) { 26 | this.batchNumber = batchNumber; 27 | } 28 | 29 | public int getBatchStatus() { 30 | return batchStatus; 31 | } 32 | 33 | public void setBatchStatus(int batchStatus) { 34 | this.batchStatus = batchStatus; 35 | } 36 | 37 | public Batch(int batchNumber, int batchStatus) { 38 | super(); 39 | this.batchNumber = batchNumber; 40 | this.batchStatus = batchStatus; 41 | } 42 | 43 | public Batch(int batchId, int batchNumber, int batchStatus) { 44 | super(); 45 | this.batchId = batchId; 46 | this.batchNumber = batchNumber; 47 | this.batchStatus = batchStatus; 48 | } 49 | 50 | public Batch() { 51 | super(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/com/y1ang/dao/VaccineMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.entity.Vaccine; 7 | /** 8 | * 9 | * @author y1ang 10 | * @Data 2018年10月13日-下午12:03:59 11 | * @Description 疫苗账单操作接口类 12 | */ 13 | public interface VaccineMapper { 14 | /** 15 | * 查询所有疫苗账单数据 16 | * @param page 17 | * @return 18 | */ 19 | public List findAllVaccine(Page page); 20 | 21 | /** 22 | * 添加疫苗账单记录 23 | * @param vaccine 24 | * @return 25 | */ 26 | public int insertVaccineRecord(Vaccine vaccine); 27 | /** 28 | * 更新疫苗账单记录 29 | * @param vaccine 30 | * @return 31 | */ 32 | public int updateVaccineRecord(Vaccine vaccine); 33 | 34 | /** 35 | * 删除疫苗账单数据 36 | * @param vaccineID 37 | * @return 38 | */ 39 | public int deleteVaccineRecord(int vaccineID); 40 | /** 41 | * 通过ID查询疫苗记录 42 | * @param vaccineID 43 | * @return 44 | */ 45 | public Vaccine findVaccineByID(int vaccineID); 46 | 47 | /** 48 | * 查询疫苗账单记录总数 49 | * @param batchNumber 50 | * @return 51 | */ 52 | public int getVaccineCount(int batchNumber); 53 | } 54 | -------------------------------------------------------------------------------- /src/com/y1ang/service/IVaccineService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.entity.Vaccine; 7 | /** 8 | * 9 | * @author y1ang 10 | * @Data 2018年10月13日-下午5:41:39 11 | * @Description 疫苗账单服务接口类 12 | */ 13 | public interface IVaccineService { 14 | /** 15 | * 查询所有疫苗账单数据 16 | * @param page 17 | * @return 18 | */ 19 | public List findAllVaccine(Page page); 20 | 21 | /** 22 | * 添加疫苗账单记录 23 | * @param vaccine 24 | * @return 25 | */ 26 | public int insertVaccineRecord(Vaccine vaccine); 27 | /** 28 | * 更新疫苗账单记录 29 | * @param vaccine 30 | * @return 31 | */ 32 | public int updateVaccineRecord(Vaccine vaccine); 33 | 34 | /** 35 | * 删除疫苗账单数据 36 | * @param vaccineID 37 | * @return 38 | */ 39 | public int deleteVaccineRecord(int vaccineID); 40 | /** 41 | * 通过ID查询疫苗记录 42 | * @param vaccineID 43 | * @return 44 | */ 45 | public Vaccine findVaccineByID(int vaccineID); 46 | /** 47 | * 查询疫苗账单记录总数 48 | * @param batchNumber 49 | * @return 50 | */ 51 | public int getVaccineCount(int batchNumber); 52 | } 53 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/IFeedServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.y1ang.dao.FeedMapper; 9 | import com.y1ang.entity.Feed; 10 | import com.y1ang.entity.Page; 11 | import com.y1ang.service.IFeedService; 12 | 13 | @Service 14 | public class IFeedServiceImpl implements IFeedService { 15 | 16 | @Autowired 17 | private FeedMapper dao; 18 | 19 | @Override 20 | public List findFeedRecord(Page page) { 21 | return dao.findFeedRecord(page); 22 | } 23 | 24 | @Override 25 | public Feed findFeedRecordByID(int feedID) { 26 | return dao.findFeedRecordByID(feedID); 27 | } 28 | 29 | @Override 30 | public int updateFeedRecord(Feed feed) { 31 | return dao.updateFeedRecord(feed); 32 | } 33 | 34 | @Override 35 | public int deleteFeedRecord(int feedID) { 36 | return dao.deleteFeedRecord(feedID); 37 | } 38 | 39 | @Override 40 | public int addFeedRecord(Feed feed) { 41 | return dao.addFeedRecord(feed); 42 | } 43 | 44 | @Override 45 | public int getFeedCount(int batchNumber) { 46 | return dao.getFeedCount(batchNumber); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/com/y1ang/service/IFeedService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Feed; 6 | import com.y1ang.entity.Page; 7 | 8 | /** 9 | * 10 | * @author y1ang 11 | * @Data 2018年10月13日-上午10:48:29 12 | * @Description 饲料账单服务层接口类 13 | */ 14 | public interface IFeedService { 15 | 16 | /** 17 | * 查询当前批次下所有饲料记录 18 | * 19 | * @param page 20 | * @return 21 | */ 22 | public List findFeedRecord(Page page); 23 | 24 | /** 25 | * 通过id查询饲料账单 26 | * 27 | * @param feedID 28 | * @return 29 | */ 30 | public Feed findFeedRecordByID(int feedID); 31 | 32 | /** 33 | * 添加饲料账单记录 34 | * 35 | * @param feed 36 | * @return 37 | */ 38 | public int addFeedRecord(Feed feed); 39 | 40 | /** 41 | * 更新饲料账单 42 | * 43 | * @param feedID 44 | * @return 45 | */ 46 | public int updateFeedRecord(Feed feed); 47 | 48 | /** 49 | * 删除饲料账单 50 | * 51 | * @param feedID 52 | * @return 53 | */ 54 | public int deleteFeedRecord(int feedID); 55 | /** 56 | * 查询饲料账单的记录总数 57 | * @param batchNumber 58 | * @return 59 | */ 60 | public int getFeedCount(int batchNumber); 61 | } 62 | -------------------------------------------------------------------------------- /src/com/y1ang/service/ISaleService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.entity.Sale; 7 | 8 | /** 9 | * 10 | * @author y1ang 11 | * @Data 2018年10月15日-下午2:45:44 12 | * @Description 卖猪账单服务接口类 13 | */ 14 | public interface ISaleService { 15 | /** 16 | * 查询所有卖猪账单 17 | * 18 | * @param page 19 | * @return 20 | */ 21 | public List findSaleRecord(Page page); 22 | 23 | /** 24 | * 查询改批次下卖猪账单的总记录数 25 | * 26 | * @param batchNumber 27 | * @return 28 | */ 29 | public int getSaleCount(int batchNumber); 30 | 31 | /** 32 | * 通过ID查询卖猪账单信息 33 | * 34 | * @param saleID 35 | * @return 36 | */ 37 | public Sale finSaleRecordByID(int saleID); 38 | 39 | /** 40 | * 插入卖猪账单 41 | * 42 | * @param sale 43 | * @return 44 | */ 45 | public int insertSaleRecord(Sale sale); 46 | 47 | /** 48 | * 更新卖猪账单 49 | * 50 | * @param sale 51 | * @return 52 | */ 53 | public int updateSaleRecord(Sale sale); 54 | 55 | /** 56 | * 删除饲料账单 57 | * 58 | * @param saleID 59 | * @return 60 | */ 61 | public int deleteSaleRecord(int saleID); 62 | } 63 | -------------------------------------------------------------------------------- /src/com/y1ang/controller/PigPriceController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | import com.y1ang.entity.PriceJson; 8 | import com.y1ang.util.GetPricesUtil; 9 | 10 | /** 11 | * 12 | * @author y1ang 13 | * @Data 2018年9月25日-下午11:49:26 14 | * @Description 获取猪价信息控制类 15 | */ 16 | @Controller 17 | public class PigPriceController { 18 | 19 | @RequestMapping("/prices.html") 20 | public String toPricePage() { 21 | return "prices.jsp"; 22 | } 23 | 24 | /** 25 | * 获取全国猪价 26 | * 27 | * @return 28 | */ 29 | @RequestMapping("/getQGPrice") 30 | @ResponseBody 31 | public PriceJson getQGPrice() { 32 | PriceJson price = GetPricesUtil.getPrices("https://zhujia.zhuwang.cc/"); 33 | return price; 34 | } 35 | 36 | /** 37 | * 获取省内猪价 38 | * 39 | * @return 40 | */ 41 | @RequestMapping("/getSNPrice") 42 | @ResponseBody 43 | public PriceJson getSNPrice() { 44 | PriceJson price = GetPricesUtil.getPrices("https://zhujia.zhuwang.cc/areapriceinfo-430000.shtml"); 45 | return price; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/IOtherServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.y1ang.dao.OtherMapper; 9 | import com.y1ang.entity.Other; 10 | import com.y1ang.entity.Page; 11 | import com.y1ang.service.IOtherService; 12 | 13 | @Service 14 | public class IOtherServiceImpl implements IOtherService { 15 | 16 | @Autowired 17 | private OtherMapper dao; 18 | 19 | /** 20 | * 查询所有其他记录信息 21 | */ 22 | @Override 23 | public List findAllOtherRecord(Page page) { 24 | return dao.findAllOtherRecord(page); 25 | } 26 | 27 | @Override 28 | public int addOtherRecord(Other other) { 29 | return dao.addOtherRecord(other); 30 | } 31 | 32 | @Override 33 | public int updateOtherRecord(Other other) { 34 | return dao.updateOtherRecord(other); 35 | } 36 | 37 | @Override 38 | public int deleteOtherRecord(int recordID) { 39 | return dao.deleteOtherRecord(recordID); 40 | } 41 | 42 | @Override 43 | public Other findOtherRecordByID(int recordID) { 44 | return dao.findOtherRecordByID(recordID); 45 | } 46 | 47 | @Override 48 | public int getOtherCount(int batchNumber) { 49 | return dao.getOtherCount(batchNumber); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/BuyJson.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 7 | * @author y1ang 8 | * @Data 2018年10月17日-下午4:29:33 9 | * @Description 购买幼猪JSON数据POJO类 10 | */ 11 | public class BuyJson { 12 | private int code; 13 | 14 | private String msg; 15 | 16 | private int count; 17 | 18 | private List data; 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | 24 | public void setCode(int code) { 25 | this.code = code; 26 | } 27 | 28 | public String getMsg() { 29 | return msg; 30 | } 31 | 32 | public void setMsg(String msg) { 33 | this.msg = msg; 34 | } 35 | 36 | public int getCount() { 37 | return count; 38 | } 39 | 40 | public void setCount(int count) { 41 | this.count = count; 42 | } 43 | 44 | public List getData() { 45 | return data; 46 | } 47 | 48 | public void setData(List data) { 49 | this.data = data; 50 | } 51 | 52 | public BuyJson(int code, String msg, int count, List data) { 53 | super(); 54 | this.code = code; 55 | this.msg = msg; 56 | this.count = count; 57 | this.data = data; 58 | } 59 | 60 | public BuyJson() { 61 | super(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/VaccineJson.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.List; 4 | /** 5 | * 6 | * @author y1ang 7 | * @Data 2018年10月13日-下午5:39:50 8 | * @Description 疫苗账单记录JSON数据POJO类 9 | */ 10 | public class VaccineJson { 11 | 12 | private int code; 13 | 14 | private String msg; 15 | 16 | private int count; 17 | 18 | private List data; 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | 24 | public void setCode(int code) { 25 | this.code = code; 26 | } 27 | 28 | public String getMsg() { 29 | return msg; 30 | } 31 | 32 | public void setMsg(String msg) { 33 | this.msg = msg; 34 | } 35 | 36 | public int getCount() { 37 | return count; 38 | } 39 | 40 | public void setCount(int count) { 41 | this.count = count; 42 | } 43 | 44 | public List getData() { 45 | return data; 46 | } 47 | 48 | public void setData(List data) { 49 | this.data = data; 50 | } 51 | 52 | public VaccineJson(int code, String msg, int count, List data) { 53 | super(); 54 | this.code = code; 55 | this.msg = msg; 56 | this.count = count; 57 | this.data = data; 58 | } 59 | 60 | public VaccineJson() { 61 | super(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/ISaleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.y1ang.dao.SaleMapper; 9 | import com.y1ang.entity.Page; 10 | import com.y1ang.entity.Sale; 11 | import com.y1ang.service.ISaleService; 12 | 13 | /** 14 | * 15 | * @author y1ang 16 | * @Data 2018年10月15日-下午2:46:35 17 | * @Description 卖猪账单实现类 18 | */ 19 | 20 | @Service 21 | public class ISaleServiceImpl implements ISaleService { 22 | 23 | @Autowired 24 | private SaleMapper dao; 25 | 26 | @Override 27 | public List findSaleRecord(Page page) { 28 | return dao.findSaleRecord(page); 29 | } 30 | 31 | @Override 32 | public int getSaleCount(int batchNumber) { 33 | return dao.getSaleCount(batchNumber); 34 | } 35 | 36 | @Override 37 | public Sale finSaleRecordByID(int saleID) { 38 | return dao.finSaleRecordByID(saleID); 39 | } 40 | 41 | @Override 42 | public int insertSaleRecord(Sale sale) { 43 | return dao.insertSaleRecord(sale); 44 | } 45 | 46 | @Override 47 | public int updateSaleRecord(Sale sale) { 48 | return dao.updateSaleRecord(sale); 49 | } 50 | 51 | @Override 52 | public int deleteSaleRecord(int saleID) { 53 | return dao.deleteSaleRecord(saleID); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 20 | 21 | 22 | 25 | 26 | 27 | update t_users set 28 | user_pwd=#{userPwd} 29 | where user_id=#{userId} 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/com/y1ang/controller/NewsController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import com.y1ang.util.GetNewsUtil; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import java.util.List; 10 | /** 11 | * 12 | * @author y1ang 13 | * @Data 2018年10月13日-上午10:23:55 14 | * @Description 首页获取新闻控制类 15 | */ 16 | @Controller 17 | public class NewsController { 18 | /** 19 | * 首页展示新闻 20 | * @return 21 | */ 22 | 23 | @RequestMapping("/index.html") 24 | public String getNews(HttpServletRequest request) { 25 | Object title = request.getSession().getAttribute("title"); 26 | Object url = request.getSession().getAttribute("url"); 27 | if(title==null&&url==null) { 28 | List> item = GetNewsUtil.getItem(); 29 | request.getSession().setAttribute("title", item.get(0)); 30 | request.getSession().setAttribute("url", item.get(1)); 31 | } 32 | return "index.jsp"; 33 | } 34 | 35 | /** 36 | * 每条新闻点进去的详情 37 | * @param url 38 | * @param title 39 | * @param model 40 | * @return 41 | */ 42 | @RequestMapping("/getMoreNews") 43 | public String getMoreNews(String url,String title,Model model) { 44 | String newsDetails = GetNewsUtil.getItemContent(url); 45 | model.addAttribute("title", title); 46 | model.addAttribute("newsDetails", newsDetails); 47 | return "newsContent.jsp"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/IVaccineServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.y1ang.dao.VaccineMapper; 9 | import com.y1ang.entity.Page; 10 | import com.y1ang.entity.Vaccine; 11 | import com.y1ang.service.IVaccineService; 12 | 13 | /** 14 | * 15 | * @author y1ang 16 | * @Data 2018年10月13日-下午5:42:20 17 | * @Description 疫苗账单服务层实现类 18 | */ 19 | @Service 20 | public class IVaccineServiceImpl implements IVaccineService { 21 | 22 | @Autowired 23 | private VaccineMapper dao; 24 | 25 | @Override 26 | public List findAllVaccine(Page page) { 27 | return dao.findAllVaccine(page); 28 | } 29 | 30 | @Override 31 | public int insertVaccineRecord(Vaccine vaccine) { 32 | return dao.insertVaccineRecord(vaccine); 33 | } 34 | 35 | @Override 36 | public int updateVaccineRecord(Vaccine vaccine) { 37 | return dao.updateVaccineRecord(vaccine); 38 | } 39 | 40 | @Override 41 | public int deleteVaccineRecord(int vaccineID) { 42 | return dao.deleteVaccineRecord(vaccineID); 43 | } 44 | 45 | @Override 46 | public Vaccine findVaccineByID(int vaccineID) { 47 | return dao.findVaccineByID(vaccineID); 48 | } 49 | 50 | @Override 51 | public int getVaccineCount(int batchNumber) { 52 | return dao.getVaccineCount(batchNumber); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/com/y1ang/dao/BatchMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.y1ang.entity.Batch; 6 | import com.y1ang.entity.Page; 7 | /** 8 | * 9 | * @author y1ang 10 | * @Data 2018年10月13日-上午10:29:28 11 | * @Description 批次操作接口类 12 | */ 13 | public interface BatchMapper { 14 | 15 | /** 16 | * 把所有批次状态变为停止状态 17 | * 18 | * @return 19 | */ 20 | public int updateAll(); 21 | 22 | /** 23 | * 更新最后一条批次的状态,变为激活状态 24 | * 25 | * @return 26 | */ 27 | public int updateLastStatus(); 28 | 29 | /** 30 | * 切换批次 将所有批次状态设为休眠状态,再将传入的批次设为激活状态 31 | * 32 | * @param batchNumber 批次号 33 | * @return 34 | */ 35 | public int updateStatus(int batchNumber); 36 | 37 | /** 38 | * 获取批次的数量,添加批次时加1 39 | * 40 | * @return 41 | */ 42 | public int getBatchCount(); 43 | 44 | /** 45 | * 添加批次 46 | * 47 | * @param batch 48 | * @return 49 | */ 50 | public int addBatch(Batch batch); 51 | 52 | /** 53 | * 查询所有批次 54 | * 55 | * @return 56 | */ 57 | public List findAllBatch(); 58 | 59 | /** 60 | * 查询那个批次是激活状态 61 | * 62 | * @return 63 | */ 64 | public int findStatusActiveBatchNumber(); 65 | 66 | /** 67 | * 分页查询所有批次 68 | * 69 | * @param page 70 | * @return 71 | */ 72 | public List findAllBatchByPage(Page page); 73 | 74 | /** 75 | * 删除批次 76 | * 77 | * @param batchId 78 | * @return 79 | */ 80 | public int deleteBatch(int batchId); 81 | } 82 | -------------------------------------------------------------------------------- /src/com/y1ang/service/IBatchService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import com.y1ang.entity.Batch; 4 | import com.y1ang.entity.Page; 5 | 6 | import java.util.List; 7 | /** 8 | * 9 | * @author y1ang 10 | * @Data 2018年10月13日-上午10:47:36 11 | * @Description 批次服务层接口类 12 | */ 13 | public interface IBatchService { 14 | /** 15 | * 把所有批次状态变为休眠状态 16 | * 17 | * @return 18 | */ 19 | public int updateAll(); 20 | 21 | /** 22 | * 更新最后一条批次的状态,变为激活状态 23 | * 24 | * @return 25 | */ 26 | public int updateLastStatus(); 27 | 28 | /** 29 | * 切换批次 将所有批次状态设为休眠状态,再将传入的批次设为激活状态 30 | * 31 | * @param batchNumber 批次号 32 | * @return 33 | */ 34 | public int updateStatus(int batchNumber); 35 | 36 | /** 37 | * 获取批次的数量,添加批次时加1 38 | * 39 | * @return 40 | */ 41 | public int getBatchCount(); 42 | 43 | /** 44 | * 添加批次 45 | * 46 | * @param batch 47 | * @return 48 | */ 49 | public int addBatch(Batch batch); 50 | 51 | /** 52 | * 查询所有批次 53 | * 54 | * @return 55 | */ 56 | public List findAllBatch(); 57 | 58 | /** 59 | * 查询那个批次是激活状态 60 | * 61 | * @return 62 | */ 63 | public int getStatusActiveBatchNumber(); 64 | 65 | /** 66 | * 分页查询所有批次 67 | * 68 | * @param page 69 | * @return 70 | */ 71 | public List findAllBatchByPage(Page page); 72 | 73 | /** 74 | * 删除批次 75 | * 76 | * @param batchId 77 | * @return 78 | */ 79 | public int deleteBatch(int batchId); 80 | } 81 | -------------------------------------------------------------------------------- /web/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /src/config/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 38 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Vaccine.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * 5 | * @author y1ang 6 | * @Data 2018年10月13日-上午10:39:05 7 | * @Description 疫苗记录POJO类 8 | */ 9 | public class Vaccine { 10 | /** 11 | * 记录ID 12 | */ 13 | private int vaccineID; 14 | /** 15 | * 疫苗种类名字 16 | */ 17 | private String vaccineName; 18 | /** 19 | * 疫苗接种日期 20 | */ 21 | private String vaccineDate; 22 | /** 23 | * 疫苗接种数量 24 | */ 25 | private String vaccineQuantity; 26 | /** 27 | * 疫苗开销花费数量 28 | */ 29 | private double vaccineMoney; 30 | /** 31 | * 批次号 32 | */ 33 | private int batchNumber; 34 | 35 | public int getVaccineID() { 36 | return vaccineID; 37 | } 38 | 39 | public void setVaccineID(int vaccineID) { 40 | this.vaccineID = vaccineID; 41 | } 42 | 43 | public String getVaccineName() { 44 | return vaccineName; 45 | } 46 | 47 | public void setVaccineName(String vaccineName) { 48 | this.vaccineName = vaccineName; 49 | } 50 | 51 | public String getVaccineDate() { 52 | return vaccineDate; 53 | } 54 | 55 | public void setVaccineDate(String vaccineDate) { 56 | this.vaccineDate = vaccineDate; 57 | } 58 | 59 | public String getVaccineQuantity() { 60 | return vaccineQuantity; 61 | } 62 | 63 | public void setVaccineQuantity(String vaccineQuantity) { 64 | this.vaccineQuantity = vaccineQuantity; 65 | } 66 | 67 | public double getVaccineMoney() { 68 | return vaccineMoney; 69 | } 70 | 71 | public void setVaccineMoney(double vaccineMoney) { 72 | this.vaccineMoney = vaccineMoney; 73 | } 74 | 75 | public int getBatchNumber() { 76 | return batchNumber; 77 | } 78 | 79 | public void setBatchNumber(int batchNumber) { 80 | this.batchNumber = batchNumber; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/IBuyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import com.y1ang.dao.BuyMapper; 4 | import com.y1ang.entity.Buy; 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.service.IBuyService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @Author y1ang 14 | * @Date 2018.10.18 18:10 15 | * @Description 购买账单服务层实现类 16 | */ 17 | @Service 18 | public class IBuyServiceImpl implements IBuyService { 19 | 20 | @Autowired 21 | private BuyMapper dao; 22 | 23 | /** 24 | * 查询所有购买账单 25 | * 26 | * @param page 27 | * @return 28 | */ 29 | @Override 30 | public List findAllBuyRecord(Page page) { 31 | return dao.findAllBuyRecord(page); 32 | } 33 | 34 | /** 35 | * 通过id查询购买账单信息 36 | * 37 | * @param buyID 38 | * @return 39 | */ 40 | @Override 41 | public Buy findBuyRecordByID(int buyID) { 42 | return dao.findBuyRecordByID(buyID); 43 | } 44 | 45 | /** 46 | * 添加购买幼猪账单信息 47 | * 48 | * @param buy 49 | * @return 50 | */ 51 | @Override 52 | public int addBuyRecord(Buy buy) { 53 | return dao.addBuyRecord(buy); 54 | } 55 | 56 | /** 57 | * 更新购买幼猪账单信息 58 | * 59 | * @param buy 60 | * @return 61 | */ 62 | @Override 63 | public int updateBuyRecord(Buy buy) { 64 | return dao.updateBuyRecord(buy); 65 | } 66 | 67 | /** 68 | * 删除购买幼猪账单信息 69 | * 70 | * @param buyID 71 | * @return 72 | */ 73 | @Override 74 | public int deleteBuyRecord(int buyID) { 75 | return dao.deleteBuyRecord(buyID); 76 | } 77 | 78 | /** 79 | * 获取当前批次账单总数 80 | * 81 | * @return 82 | */ 83 | @Override 84 | public int getBuyCount() { 85 | return dao.getBuyCount(); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /web/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /web/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | CharacterEncodingFilter 8 | org.springframework.web.filter.CharacterEncodingFilter 9 | 10 | encoding 11 | UTF-8 12 | 13 | 14 | forceEncoding 15 | true 16 | 17 | 18 | 19 | CharacterEncodingFilter 20 | /* 21 | 22 | 23 | 24 | contextConfigLocation 25 | classpath:config/beans.xml 26 | 27 | 28 | 29 | org.springframework.web.context.ContextLoaderListener 30 | 31 | 32 | 33 | springDispatcherServlet 34 | org.springframework.web.servlet.DispatcherServlet 35 | 36 | contextConfigLocation 37 | classpath:config/spring-mvc.xml 38 | 39 | 1 40 | 41 | 42 | 43 | springDispatcherServlet 44 | / 45 | 46 | 47 | 48 | 404 49 | /WEB-INF/pages/404.jsp 50 | 51 | -------------------------------------------------------------------------------- /web/WEB-INF/pages/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" 2 | pageEncoding="utf-8"%> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 404 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 | 25 |
26 |
27 |
28 |
29 | 30 |
31 |
32 |
33 |
34 | 35 |
36 |
37 |
OH! 38 | 39 |
40 |
41 |

很抱歉,你访问的页面去火星旅游了

42 |

43 | 返回首页 44 |

45 |
46 |
47 |
48 | 53 | 54 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/BatchMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 11 | 12 | 13 | 14 | insert into t_batch 15 | values(0,#{batchNumber},#{batchStatus}) 16 | 17 | 18 | 19 | update t_batch set batch_status=0 20 | 21 | 22 | 23 | 24 | update t_batch set batch_status=1 where 1 order by 25 | batch_id DESC limit 1 26 | 27 | 28 | 29 | 30 | update t_batch set 31 | batch_status=1 where batch_number = #{batchNumber} 32 | 33 | 34 | 35 | 40 | 41 | 42 | 46 | 47 | 48 | 52 | 53 | 54 | 59 | 60 | 61 | 62 | delete from t_batch where 63 | batch_id=#{batchId} 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Feed.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * 5 | * @author y1ang 6 | * @Data 2018年10月4日-下午8:47:57 7 | * @Description 饲料账单POJO类 8 | */ 9 | 10 | public class Feed { 11 | /** 12 | * 唯一ID 13 | */ 14 | private int feedID; 15 | /** 16 | * 配送日期 17 | */ 18 | private String sendDate; 19 | /** 20 | * 配送数量 21 | */ 22 | private int feedQuantity; 23 | /** 24 | * 单价 25 | */ 26 | private double feedPrice; 27 | /** 28 | * 支付状态 29 | */ 30 | private String feedPayState; 31 | /** 32 | * 价格总数 33 | */ 34 | private double feedTotal; 35 | /** 36 | * 批次号 37 | */ 38 | 39 | public int batchNumber; 40 | 41 | public int getFeedID() { 42 | return feedID; 43 | } 44 | 45 | public void setFeedID(int feedID) { 46 | this.feedID = feedID; 47 | } 48 | 49 | public String getSendDate() { 50 | return sendDate; 51 | } 52 | 53 | public void setSendDate(String sendDate) { 54 | this.sendDate = sendDate; 55 | } 56 | 57 | public int getFeedQuantity() { 58 | return feedQuantity; 59 | } 60 | 61 | public void setFeedQuantity(int feedQuantity) { 62 | this.feedQuantity = feedQuantity; 63 | } 64 | 65 | public double getFeedPrice() { 66 | return feedPrice; 67 | } 68 | 69 | public void setFeedPrice(double feedPrice) { 70 | this.feedPrice = feedPrice; 71 | } 72 | 73 | public String getFeedPayState() { 74 | return feedPayState; 75 | } 76 | 77 | public void setFeedPayState(String feedPayState) { 78 | this.feedPayState = feedPayState; 79 | } 80 | 81 | public double getFeedTotal() { 82 | return feedTotal; 83 | } 84 | 85 | public void setFeedTotal(double feedTotal) { 86 | this.feedTotal = feedTotal; 87 | } 88 | 89 | public int getBatchNumber() { 90 | return batchNumber; 91 | } 92 | 93 | public void setBatchNumber(int batchNumber) { 94 | this.batchNumber = batchNumber; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * 7 | * @author y1ang 8 | * @Data 2018年10月2日-下午4:58:52 9 | * @Description 用户POJO类 10 | */ 11 | 12 | public class User { 13 | 14 | private int userId; 15 | private String userName; 16 | private String userPwd; 17 | private String phone; 18 | private Date createDate; 19 | 20 | public int getUserId() { 21 | return userId; 22 | } 23 | 24 | public void setUserId(int userId) { 25 | this.userId = userId; 26 | } 27 | 28 | public String getUserName() { 29 | return userName; 30 | } 31 | 32 | public void setUserName(String userName) { 33 | this.userName = userName; 34 | } 35 | 36 | public String getUserPwd() { 37 | return userPwd; 38 | } 39 | 40 | public void setUserPwd(String userPwd) { 41 | this.userPwd = userPwd; 42 | } 43 | 44 | public String getPhone() { 45 | return phone; 46 | } 47 | 48 | public void setPhone(String phone) { 49 | this.phone = phone; 50 | } 51 | 52 | public Date getCreateDate() { 53 | return createDate; 54 | } 55 | 56 | public void setCreateDate(Date createDate) { 57 | this.createDate = createDate; 58 | } 59 | 60 | public User(String userName, String userPwd, String phone, Date createDate) { 61 | super(); 62 | this.userName = userName; 63 | this.userPwd = userPwd; 64 | this.phone = phone; 65 | this.createDate = createDate; 66 | } 67 | 68 | public User(int userId, String userName, String userPwd, String phone, Date createDate) { 69 | super(); 70 | this.userId = userId; 71 | this.userName = userName; 72 | this.userPwd = userPwd; 73 | this.phone = phone; 74 | this.createDate = createDate; 75 | } 76 | 77 | public User() { 78 | super(); 79 | } 80 | 81 | public User(String userName, String userPwd) { 82 | super(); 83 | this.userName = userName; 84 | this.userPwd = userPwd; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/com/y1ang/service/ICountService.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service; 2 | 3 | import com.y1ang.entity.ProfitAndLoss; 4 | 5 | /** 6 | * @author y1ang 7 | * @Data 2018.10.24 19:18 8 | * @Description 9 | */ 10 | public interface ICountService { 11 | 12 | /** 13 | * 获取盈亏账单 14 | * 15 | * @param batchNumber 16 | * @return 17 | */ 18 | public ProfitAndLoss getProfitAndLoss(int batchNumber); 19 | 20 | /** 21 | * 获取已支付的饲料包数 22 | * 23 | * @param batchNumber 24 | * @return 25 | */ 26 | public int getPaidFeedAmount(int batchNumber); 27 | 28 | /** 29 | * 获取未支付的饲料包数 30 | * 31 | * @param batchNumber 32 | * @return 33 | */ 34 | public int getUnPaidFeedAmount(int batchNumber); 35 | 36 | /** 37 | * 获取合计饲料数目 38 | * 39 | * @param batchNumber 40 | * @return 41 | */ 42 | public int getAllFeedAmount(int batchNumber); 43 | 44 | /** 45 | * 获取已支付饲料金额 46 | * 47 | * @param batchNumber 48 | * @return 49 | */ 50 | public double getPaidMoney(int batchNumber); 51 | 52 | /** 53 | * 获取未支付饲料金额 54 | * 55 | * @param batchNumber 56 | * @return 57 | */ 58 | public double getUnPaidMoney(int batchNumber); 59 | 60 | /** 61 | * 查询饲料总开支 62 | * 63 | * @param batchNumber 64 | * @return 65 | */ 66 | public double getFeedMoney(int batchNumber); 67 | 68 | /** 69 | * 查询购买小猪账单 70 | * 71 | * @param batchNumber 72 | * @return 73 | */ 74 | public double getPigletMoney(int batchNumber); 75 | 76 | /** 77 | * 查询卖猪账单统计 78 | * 79 | * @param batchNumber 80 | * @return 81 | */ 82 | public double getSaleMoney(int batchNumber); 83 | 84 | /** 85 | * 查询疫苗统计账单合计 86 | * 87 | * @param batchNumber 88 | * @return 89 | */ 90 | public double getVaccineMoney(int batchNumber); 91 | 92 | /** 93 | * 查询其他账单合计 94 | * 95 | * @param batchNumber 96 | * @return 97 | */ 98 | public double getOtherMoney(int batchNumber); 99 | } 100 | -------------------------------------------------------------------------------- /src/com/y1ang/dao/CountMapper.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.dao; 2 | 3 | import com.y1ang.entity.ProfitAndLoss; 4 | 5 | /** 6 | * @author y1ang 7 | * @Data 2018.10.19 18:00 8 | * @Description 统计结果接口类 9 | */ 10 | public interface CountMapper { 11 | 12 | /** 13 | * 获取盈亏账单 14 | * 15 | * @param batchNumber 16 | * @return 17 | */ 18 | public ProfitAndLoss getProfitAndLoss(int batchNumber); 19 | 20 | /** 21 | * 获取已支付的饲料包数 22 | * 23 | * @param batchNumber 24 | * @return 25 | */ 26 | public int getPaidFeedAmount(int batchNumber); 27 | 28 | /** 29 | * 获取未支付的饲料包数 30 | * 31 | * @param batchNumber 32 | * @return 33 | */ 34 | public int getUnPaidFeedAmount(int batchNumber); 35 | 36 | /** 37 | * 获取合计饲料数目 38 | * 39 | * @param batchNumber 40 | * @return 41 | */ 42 | public int getAllFeedAmount(int batchNumber); 43 | 44 | /** 45 | * 获取已支付饲料金额 46 | * 47 | * @param batchNumber 48 | * @return 49 | */ 50 | public double getPaidMoney(int batchNumber); 51 | 52 | /** 53 | * 获取未支付饲料金额 54 | * 55 | * @param batchNumber 56 | * @return 57 | */ 58 | public double getUnPaidMoney(int batchNumber); 59 | 60 | /** 61 | * 查询饲料总开支 62 | * 63 | * @param batchNumber 64 | * @return 65 | */ 66 | public double getFeedMoney(int batchNumber); 67 | 68 | /** 69 | * 查询购买小猪账单 70 | * 71 | * @param batchNumber 72 | * @return 73 | */ 74 | public double getPigletMoney(int batchNumber); 75 | 76 | /** 77 | * 查询卖猪账单统计 78 | * 79 | * @param batchNumber 80 | * @return 81 | */ 82 | public double getSaleMoney(int batchNumber); 83 | 84 | /** 85 | * 查询疫苗统计账单合计 86 | * 87 | * @param batchNumber 88 | * @return 89 | */ 90 | public double getVaccineMoney(int batchNumber); 91 | 92 | /** 93 | * 查询其他账单合计 94 | * 95 | * @param batchNumber 96 | * @return 97 | */ 98 | public double getOtherMoney(int batchNumber); 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/OtherMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 | 37 | 38 | 39 | 40 | insert into t_other values(0,#{recordDate},#{recordDetails},#{recordMoney},#{batchNumber}) 41 | 42 | 43 | 44 | 45 | update 46 | t_other 47 | set 48 | record_date=#{recordDate}, 49 | record_details=#{recordDetails}, 50 | record_money=#{recordMoney} 51 | where record_id=#{recordID} 52 | 53 | 54 | 55 | 56 | delete from t_other where record_id=#{recordID} 57 | 58 | 59 | 60 | 63 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Other.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * 5 | * @author y1ang 6 | * @Data 2018年10月13日-上午10:34:49 7 | * @Description 其他账单POJO类 8 | */ 9 | public class Other { 10 | /** 11 | * 记录ID 12 | */ 13 | private int recordID; 14 | /** 15 | * 记录日期 16 | */ 17 | private String recordDate; 18 | /** 19 | * 记录详情 20 | */ 21 | private String recordDetails; 22 | /** 23 | * 其他支出总额 24 | */ 25 | private double recordMoney; 26 | /** 27 | * 批次号 28 | */ 29 | private int batchNumber; 30 | 31 | public int getRecordID() { 32 | return recordID; 33 | } 34 | 35 | public void setRecordID(int recordID) { 36 | this.recordID = recordID; 37 | } 38 | 39 | public String getRecordDate() { 40 | return recordDate; 41 | } 42 | 43 | public void setRecordDate(String recordDate) { 44 | this.recordDate = recordDate; 45 | } 46 | 47 | public String getRecordDetails() { 48 | return recordDetails; 49 | } 50 | 51 | public void setRecordDetails(String recordDetails) { 52 | this.recordDetails = recordDetails; 53 | } 54 | 55 | public double getRecordMoney() { 56 | return recordMoney; 57 | } 58 | 59 | public void setRecordMoney(double recordMoney) { 60 | this.recordMoney = recordMoney; 61 | } 62 | 63 | public int getBatchNumber() { 64 | return batchNumber; 65 | } 66 | 67 | public void setBatchNumber(int batchNumber) { 68 | this.batchNumber = batchNumber; 69 | } 70 | 71 | public Other(int recordID, String recordDate, String recordDetails, double recordMoney, int batchNumber) { 72 | super(); 73 | this.recordID = recordID; 74 | this.recordDate = recordDate; 75 | this.recordDetails = recordDetails; 76 | this.recordMoney = recordMoney; 77 | this.batchNumber = batchNumber; 78 | } 79 | 80 | public Other(String recordDate, String recordDetails, double recordMoney, int batchNumber) { 81 | super(); 82 | this.recordDate = recordDate; 83 | this.recordDetails = recordDetails; 84 | this.recordMoney = recordMoney; 85 | this.batchNumber = batchNumber; 86 | } 87 | 88 | public Other() { 89 | super(); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/IBatchServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import com.y1ang.dao.BatchMapper; 4 | import com.y1ang.entity.Batch; 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.service.IBatchService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | /** 12 | * @Author y1ang 13 | * @Date 2018.10.14 18:10 14 | * @Description 设置界面服务层实现类 15 | */ 16 | @Service 17 | public class IBatchServiceImpl implements IBatchService { 18 | 19 | @Autowired 20 | private BatchMapper dao; 21 | 22 | /** 23 | * 把所有批次状态变为休眠状态 24 | * 25 | * @return 26 | */ 27 | @Override 28 | public int updateAll() { 29 | return dao.updateAll(); 30 | } 31 | 32 | /** 33 | * 更新最后一条批次的状态,变为激活状态 34 | * 35 | * @return 36 | */ 37 | @Override 38 | public int updateLastStatus() { 39 | return dao.updateLastStatus(); 40 | } 41 | 42 | /** 43 | * 切换批次 将所有批次状态设为休眠状态,再将传入的批次设为激活状态 44 | * 45 | * @param batchNumber 批次号 46 | * @return 47 | */ 48 | @Override 49 | public int updateStatus(int batchNumber) { 50 | return dao.updateStatus(batchNumber); 51 | } 52 | 53 | /** 54 | * 获取批次的数量,添加批次时加1 55 | * 56 | * @return 57 | */ 58 | @Override 59 | public int getBatchCount() { 60 | return dao.getBatchCount(); 61 | } 62 | 63 | /** 64 | * 添加批次 65 | * 66 | * @param batch 67 | * @return 68 | */ 69 | @Override 70 | public int addBatch(Batch batch) { 71 | return dao.addBatch(batch); 72 | } 73 | 74 | /** 75 | * 查询所有批次 76 | * 77 | * @return 78 | */ 79 | @Override 80 | public List findAllBatch() { 81 | return dao.findAllBatch(); 82 | } 83 | 84 | /** 85 | * 查询那个批次是激活状态 86 | * 87 | * @return 88 | */ 89 | @Override 90 | public int getStatusActiveBatchNumber() { 91 | return dao.findStatusActiveBatchNumber(); 92 | } 93 | 94 | /** 95 | * 分页查询所有批次 96 | * 97 | * @param page 98 | * @return 99 | */ 100 | @Override 101 | public List findAllBatchByPage(Page page) { 102 | return dao.findAllBatchByPage(page); 103 | } 104 | 105 | /** 106 | * 删除批次 107 | * 108 | * @param batchId 109 | * @return 110 | */ 111 | @Override 112 | public int deleteBatch(int batchId) { 113 | return dao.deleteBatch(batchId); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /web/WEB-INF/pages/about.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: stark 4 | Date: 2018.10.28 5 | Time: 12:42 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 | 23 |
24 |
25 | 关于助手 26 |
27 |
28 |
29 |
30 |
31 |
32 |
    33 |
  • 34 | 35 |
    36 |

    10月28日

    37 |

    38 | 修复一系列bug
    39 | 完善用户体验 40 |

    41 |
    42 |
  • 43 |
  • 44 | 45 |
    46 |

    开发者信息

    47 |

    48 | y1ang
    49 | 江上清风游
    50 | 明月逐人归
    51 |

    52 |
    53 |
  • 54 |
  • 55 | 56 |
    57 |

    未完待续...

    58 |

    59 |
    60 |
  • 61 |
62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/FeedMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 31 | 32 | 33 | 44 | 45 | 46 | 47 | insert into t_feed value(0,#{sendDate},#{feedQuantity},#{feedPrice},#{feedPayState},#{feedTotal},#{batchNumber}) 48 | 49 | 50 | 51 | 52 | update 53 | t_feed 54 | set 55 | send_date = #{sendDate}, 56 | feed_quantity = #{feedQuantity}, 57 | feed_price = #{feedPrice}, 58 | feed_paystate = #{feedPayState}, 59 | feed_total = #{feedTotal} 60 | where 61 | feed_id = #{feedID} 62 | 63 | 64 | 65 | delete from t_feed where feed_id = #{feedID} 66 | 67 | 68 | 69 | 72 | -------------------------------------------------------------------------------- /web/js/signin.js: -------------------------------------------------------------------------------- 1 | layui.use(['element', 'form', 'layer'], function () { 2 | var element = layui.element, 3 | form = layui.form, 4 | $ = layui.jquery, 5 | layer = layui.layer; 6 | 7 | $(function () { 8 | layer.msg("请您先登录",{offset: '130',time:3000}); 9 | $("#username").val(layui.data("user").username); 10 | $("#pwd").val(layui.data("pwd").pwd) 11 | 12 | if(layui.data('user').username != undefined){ 13 | $(":checkbox").attr('checked',true); 14 | form.render('checkbox'); 15 | } 16 | 17 | var flag = true; 18 | $('.show-pwd').click(function () { 19 | if(flag == true){ 20 | $('#pwd').prop('type','text'); 21 | flag = false; 22 | }else{ 23 | $('#pwd').prop('type','password'); 24 | flag = true; 25 | } 26 | }); 27 | 28 | $('button').click(function () { 29 | if ($("#username").val() == "") { 30 | layer.msg("请输入用户名"); 31 | $("#username").focus(); 32 | } else if ($("#pwd").val() == "") { 33 | layer.msg("请输入密码"); 34 | $("#pwd").focus(); 35 | } else { 36 | if ($(":checkbox").is(':checked')) { 37 | layui.data("user", { 38 | key: 'username', 39 | value: $("#username").val() 40 | }); 41 | layui.data("pwd", { 42 | key: "pwd", 43 | value: $("#pwd").val() 44 | }); 45 | } else { 46 | layui.data('user', { 47 | key: 'username' 48 | , remove: true 49 | }); 50 | layui.data('pwd', { 51 | key: 'pwd' 52 | , remove: true 53 | }); 54 | } 55 | 56 | var lay_index = layer.open({type:3}); 57 | $.post("check",$('form').serialize(),function (result) { 58 | layer.close(lay_index) 59 | if(result == "FAIL"){ 60 | layer.msg("登录失败,请检查用户名或密码是否正确",{anim: 6}); 61 | } 62 | if(result == "OK"){ 63 | $('form').submit(); 64 | } 65 | }) 66 | } 67 | }) 68 | }) 69 | }); -------------------------------------------------------------------------------- /src/config/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/com/y1ang/interceptor/LoginInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.interceptor; 2 | 3 | import com.ndktools.javamd5.Mademd5; 4 | import com.y1ang.entity.User; 5 | import com.y1ang.service.IUserService; 6 | import org.springframework.web.servlet.HandlerInterceptor; 7 | 8 | import javax.annotation.Resource; 9 | import javax.servlet.http.Cookie; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import javax.servlet.http.HttpSession; 13 | 14 | /** 15 | * @author y1ang 16 | * @Data 2018年09月28日-上午10:39:48 17 | * @Description 用户登录拦截器 18 | */ 19 | public class LoginInterceptor implements HandlerInterceptor { 20 | /** 21 | * 注入用户登录方法接口类 22 | */ 23 | @Resource 24 | private IUserService service; 25 | 26 | @Override 27 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 28 | throws Exception { 29 | 30 | final String loginAction = "/sign"; 31 | final String loginCheckAction = "/check"; 32 | 33 | request.setCharacterEncoding("utf-8"); 34 | String url = request.getRequestURL().toString(); 35 | if (url.indexOf(loginAction) >= 0 || url.indexOf(loginCheckAction) >= 0) { 36 | return true; 37 | } 38 | 39 | HttpSession session = request.getSession(); 40 | User u = (User) session.getAttribute("UserSession"); 41 | if (u != null) { 42 | return true; 43 | } 44 | 45 | Cookie[] cookies = request.getCookies(); 46 | if (cookies != null) { 47 | for (Cookie c : cookies) { 48 | if ("user".equals(c.getName())) { 49 | User findUser = service.findUser(Integer.parseInt(c.getValue().split("-")[2])); 50 | Mademd5 md5 = new Mademd5(); 51 | String cName = c.getValue().split("-")[0]; 52 | String cPassword = c.getValue().split("-")[1]; 53 | String md5Name = md5.toMd5("ACD244" + findUser.getUserName() + "14DS4DS"); 54 | String md5Password = md5.toMd5("ACD244" + findUser.getUserPwd() + "14DS4DS"); 55 | if (cName.equals(md5Name) && cPassword.equals(md5Password)) { 56 | request.getSession().setAttribute("UserSession", findUser); 57 | request.getRequestDispatcher("/index.html").forward(request, response); 58 | return true; 59 | } 60 | } 61 | } 62 | } 63 | request.getRequestDispatcher("/WEB-INF/pages/login.jsp").forward(request, response); 64 | return false; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /web/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
    ",u=1;u<=i.length;u++){var r='
  • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
  • ":n+=r}n+="
"+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /web/WEB-INF/pages/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 47 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/com/y1ang/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import com.ndktools.javamd5.Mademd5; 4 | import com.y1ang.entity.User; 5 | import com.y1ang.service.IUserService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | 11 | import javax.servlet.http.Cookie; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | 15 | /** 16 | * @author y1ang 17 | * @Data 2018年8月25日-下午11:55:30 18 | * @Description 用户登录控制类 19 | */ 20 | @Controller 21 | public class UserController { 22 | 23 | @Autowired 24 | private IUserService service; 25 | 26 | @RequestMapping("/sign") 27 | public String toSignPage() { 28 | return "login.jsp"; 29 | } 30 | 31 | /** 32 | * 登陆验证 33 | * 34 | * @param username 35 | * @param pwd 36 | * @return 37 | */ 38 | @RequestMapping("/check") 39 | @ResponseBody 40 | public String check(String username, String pwd) { 41 | User user = new User(username, pwd); 42 | User u = service.login(user); 43 | if (u != null) { 44 | return "OK"; 45 | } 46 | return "FAIL"; 47 | } 48 | 49 | /** 50 | * 登录 51 | * 52 | * @param username 53 | * @param pwd 54 | * @param request 55 | * @return 56 | */ 57 | @RequestMapping("/signin") 58 | public String login(String username, String pwd, String auto_login, HttpServletRequest request, 59 | HttpServletResponse response) { 60 | User user = new User(username, pwd); 61 | User u = service.login(user); 62 | if (u != null) { 63 | request.getSession().setAttribute("UserSession", u); 64 | Cookie cookie = null; 65 | if (auto_login != null) { 66 | // 7天内自动登录 67 | int seconds = 7 * 24 * 60 * 60; 68 | // 保存在Cookie中 69 | Mademd5 md = new Mademd5(); 70 | // MD5加密加盐 71 | cookie = new Cookie("user", 72 | md.toMd5("ACD244" + username + "14DS4DS") + "-" + md.toMd5("ACD244" + pwd + "14DS4DS")+"-"+u.getUserId()); 73 | cookie.setMaxAge(seconds); 74 | cookie.setPath("/"); 75 | response.addCookie(cookie); 76 | } else { 77 | cookie = new Cookie("user", ""); 78 | cookie.setMaxAge(0); 79 | response.addCookie(cookie); 80 | } 81 | return "redirect:index.html"; 82 | } 83 | return "login.jsp"; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/VaccineMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 28 | 29 | 30 | 31 | insert into t_vaccine values(0,#{vaccineName},#{vaccineDate},#{vaccineQuantity},#{vaccineMoney},#{batchNumber}) 32 | 33 | 34 | 35 | 36 | update 37 | t_vaccine 38 | set 39 | vaccine_name = #{vaccineName}, 40 | vaccine_date = #{vaccineDate}, 41 | vaccine_quantity = #{vaccineQuantity}, 42 | vaccine_money = #{vaccineMoney} 43 | where 44 | vaccine_id = #{vaccineID} 45 | 46 | 47 | 48 | 49 | delete from t_vaccine where vaccine_id = #{vaccineID} 50 | 51 | 52 | 53 | 65 | 66 | 67 | 70 | 71 | -------------------------------------------------------------------------------- /web/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
    '),s=o(["
  • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
  • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
    '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /.idea/artifacts/pighelper_war_exploded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/pighelper_war_exploded 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /web/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,a,n="layui-fixbar",r="layui-fixbar-top",o=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['
      ',t.bar1?'
    • '+c[0]+"
    • ":"",t.bar2?'
    • '+c[1]+"
    • ":"",'
    • '+c[2]+"
    • ","
    "].join("")),s=g.find("."+r),u=function(){var e=o.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+n)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),a=i.attr("lay-type");"top"===a&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,a)}),o.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var a=this,n="function"==typeof e,r=new Date(t).getTime(),o=new Date(!e||n?(new Date).getTime():e).getTime(),l=r-o,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];n&&(i=e);var g=setTimeout(function(){a.countdown(t,o+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,a=[[],[]],n=(new Date).getTime()-new Date(t).getTime();return n>6912e5?(n=new Date(t),a[0][0]=i.digit(n.getFullYear(),4),a[0][1]=i.digit(n.getMonth()+1),a[0][2]=i.digit(n.getDate()),e||(a[1][0]=i.digit(n.getHours()),a[1][1]=i.digit(n.getMinutes()),a[1][2]=i.digit(n.getSeconds())),a[0].join("-")+" "+a[1].join(":")):n>=864e5?(n/1e3/60/60/24|0)+"天前":n>=36e5?(n/1e3/60/60|0)+"小时前":n>=12e4?(n/1e3/60|0)+"分钟前":n<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var a=t.length;a/g,">").replace(/'/g,"'").replace(/"/g,""")}};!function(t,e,i){"$:nomunge";function a(){n=e[l](function(){r.each(function(){var e=t(this),i=e.width(),a=e.height(),n=t.data(this,g);(i!==n.w||a!==n.h)&&e.trigger(c,[n.w=i,n.h=a])}),a()},o[s])}var n,r=t([]),o=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";o[s]=250,o[u]=!0,t.event.special[c]={setup:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===r.length&&a()},teardown:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.not(e),e.removeData(g),r.length||clearTimeout(n)},add:function(e){function a(e,a,r){var o=t(this),l=t.data(this,g)||{};l.w=a!==i?a:o.width(),l.h=r!==i?r:o.height(),n.apply(this,arguments)}if(!o[u]&&this[l])return!1;var n;return t.isFunction(e)?(n=e,a):(n=e.handler,void(e.handler=a))}}}(e,window),t("util",i)}); -------------------------------------------------------------------------------- /web/WEB-INF/pages/newsContent.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" 2 | pageEncoding="utf-8"%> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | ${title } 12 | 20 | 21 | 22 |
    23 |
    24 |
    25 |
    26 | 27 |
    28 |
    29 |  资讯详情 30 |
    31 |
    32 |
    33 |
    34 |
    35 |
    36 |

    ${title }

    37 |
    38 |
    39 | ${newsDetails } 40 |
    41 |
    42 |

    数据来源:中国养猪网

    43 |
    44 | 64 | 65 | 84 | 85 | -------------------------------------------------------------------------------- /web/WEB-INF/pages/batchmanager.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" 2 | pageEncoding="utf-8"%> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 批次管理 11 | 12 | 13 |
    14 |
    15 |
    16 |
    17 | 18 |
    19 |
    20 |  批次管理 21 |
    22 |
    23 |
    24 |
    25 | 26 |
    27 |
    28 |
    29 | 30 | 31 | 77 | 80 | 87 | 88 | -------------------------------------------------------------------------------- /src/com/y1ang/service/impl/ICountServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.service.impl; 2 | 3 | import com.y1ang.dao.CountMapper; 4 | import com.y1ang.entity.ProfitAndLoss; 5 | import com.y1ang.service.ICountService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * @author y1ang 11 | * @Data 2018.10.24 19:19 12 | * @Description 13 | */ 14 | 15 | @Service 16 | public class ICountServiceImpl implements ICountService { 17 | 18 | @Autowired 19 | private CountMapper mapper; 20 | 21 | /** 22 | * 获取盈亏账单 23 | * 24 | * @param batchNumber 25 | * @return 26 | */ 27 | @Override 28 | public ProfitAndLoss getProfitAndLoss(int batchNumber) { 29 | return mapper.getProfitAndLoss(batchNumber); 30 | } 31 | 32 | /** 33 | * 获取已支付的饲料包数 34 | * 35 | * @param batchNumber 36 | * @return 37 | */ 38 | @Override 39 | public int getPaidFeedAmount(int batchNumber) { 40 | return mapper.getPaidFeedAmount(batchNumber); 41 | } 42 | 43 | /** 44 | * 获取未支付的饲料包数 45 | * 46 | * @param batchNumber 47 | * @return 48 | */ 49 | @Override 50 | public int getUnPaidFeedAmount(int batchNumber) { 51 | return mapper.getUnPaidFeedAmount(batchNumber); 52 | } 53 | 54 | /** 55 | * 获取合计饲料数目 56 | * 57 | * @param batchNumber 58 | * @return 59 | */ 60 | @Override 61 | public int getAllFeedAmount(int batchNumber) { 62 | return mapper.getAllFeedAmount(batchNumber); 63 | } 64 | 65 | /** 66 | * 获取已支付饲料金额 67 | * 68 | * @param batchNumber 69 | * @return 70 | */ 71 | @Override 72 | public double getPaidMoney(int batchNumber) { 73 | return mapper.getPaidMoney(batchNumber); 74 | } 75 | 76 | /** 77 | * 获取未支付饲料金额 78 | * 79 | * @param batchNumber 80 | * @return 81 | */ 82 | @Override 83 | public double getUnPaidMoney(int batchNumber) { 84 | return mapper.getUnPaidMoney(batchNumber); 85 | } 86 | 87 | /** 88 | * 查询饲料总开支 89 | * 90 | * @param batchNumber 91 | * @return 92 | */ 93 | @Override 94 | public double getFeedMoney(int batchNumber) { 95 | return mapper.getFeedMoney(batchNumber); 96 | } 97 | 98 | /** 99 | * 查询购买小猪账单 100 | * 101 | * @param batchNumber 102 | * @return 103 | */ 104 | @Override 105 | public double getPigletMoney(int batchNumber) { 106 | return mapper.getPigletMoney(batchNumber); 107 | } 108 | 109 | /** 110 | * 查询卖猪账单统计 111 | * 112 | * @param batchNumber 113 | * @return 114 | */ 115 | @Override 116 | public double getSaleMoney(int batchNumber) { 117 | return mapper.getSaleMoney(batchNumber); 118 | } 119 | 120 | /** 121 | * 查询疫苗统计账单合计 122 | * 123 | * @param batchNumber 124 | * @return 125 | */ 126 | @Override 127 | public double getVaccineMoney(int batchNumber) { 128 | return mapper.getVaccineMoney(batchNumber); 129 | } 130 | 131 | /** 132 | * 查询其他账单合计 133 | * 134 | * @param batchNumber 135 | * @return 136 | */ 137 | @Override 138 | public double getOtherMoney(int batchNumber) { 139 | return mapper.getOtherMoney(batchNumber); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /src/com/y1ang/controller/OtherController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | 11 | import com.y1ang.entity.Other; 12 | import com.y1ang.entity.OtherJson; 13 | import com.y1ang.entity.Page; 14 | import com.y1ang.service.IBatchService; 15 | import com.y1ang.service.IOtherService; 16 | /** 17 | * 18 | * @author y1ang 19 | * @Data 2018年10月13日-上午10:26:06 20 | * @Description 其他账单控制类 21 | */ 22 | @Controller 23 | public class OtherController { 24 | 25 | @Autowired 26 | private IOtherService service; 27 | @Autowired 28 | private IBatchService ibs; 29 | 30 | /** 31 | * 跳转到其他界面 32 | * 33 | * @return 34 | */ 35 | @RequestMapping("/other.html") 36 | public String toOtherPage() { 37 | return "other.jsp"; 38 | } 39 | 40 | /** 41 | * 显示所有其他记录 42 | * 43 | * @param page 44 | * @param limit 45 | * @return 46 | */ 47 | @RequestMapping("/allother") 48 | @ResponseBody 49 | public OtherJson findAllRecord(int page, int limit) { 50 | Page p = new Page((page - 1) * limit, limit); 51 | List list = service.findAllOtherRecord(p); 52 | int activeBatch = ibs.getStatusActiveBatchNumber(); 53 | OtherJson oj = new OtherJson(0, "200", service.getOtherCount(activeBatch), list); 54 | return oj; 55 | } 56 | 57 | /** 58 | * 跳转到添加其他记录界面 59 | * 60 | * @return 61 | */ 62 | @RequestMapping("/addother.html") 63 | public String addOtherPage() { 64 | return "addother.jsp"; 65 | } 66 | 67 | /** 68 | * 添加其他记录 69 | * 70 | * @param other 71 | * @return 72 | */ 73 | @RequestMapping("/addother") 74 | @ResponseBody 75 | public String addOther(Other other) { 76 | int batchNumber = ibs.getStatusActiveBatchNumber(); 77 | other.setBatchNumber(batchNumber); 78 | int n = service.addOtherRecord(other); 79 | if (n > 0) { 80 | return "OK"; 81 | } 82 | return "FAIL"; 83 | } 84 | 85 | @RequestMapping("/updateother.html") 86 | public String toUpdatePage(int recordID, Model model) { 87 | Other other = service.findOtherRecordByID(recordID); 88 | model.addAttribute("other", other); 89 | return "updateother.jsp"; 90 | } 91 | 92 | /** 93 | * 更新其他记录 94 | * 95 | * @param other 96 | * @return 97 | */ 98 | @RequestMapping("updateother") 99 | @ResponseBody 100 | public String updateOtherRecord(Other other) { 101 | int n = service.updateOtherRecord(other); 102 | if (n > 0) { 103 | return "OK"; 104 | } 105 | return "FAIL"; 106 | } 107 | 108 | /** 109 | * 删除其他记录 110 | * 111 | * @param recordID 112 | * @return 113 | */ 114 | @RequestMapping("/deleteother") 115 | @ResponseBody 116 | public String deleteOtherRecord(int recordID) { 117 | int n = service.deleteOtherRecord(recordID); 118 | if (n > 0) { 119 | return "OK"; 120 | } 121 | return "FAIL"; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/BuyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 36 | 37 | 38 | 52 | 53 | 54 | 57 | 58 | 59 | insert into 60 | t_buy 61 | values( 62 | 0, 63 | #{buyDate}, 64 | #{buyQuantity}, 65 | #{buyVariety}, 66 | #{buyPrice}, 67 | #{buyAddress}, 68 | #{averageWeight}, 69 | #{beyondPrice}, 70 | #{totalMoney}, 71 | #{batchNumber} 72 | ) 73 | 74 | 75 | 76 | update t_buy set 77 | buy_date = #{buyDate}, 78 | buy_quantity = #{buyQuantity}, 79 | buy_variety = #{buyVariety}, 80 | buy_price = #{buyPrice}, 81 | buy_address = #{buyAddress}, 82 | average_weight = #{averageWeight}, 83 | beyond_price = #{beyondPrice}, 84 | total_money = #{totalMoney} 85 | where buy_id = #{buyID} 86 | 87 | 88 | 89 | delete from t_buy where buy_id = #{buyID} 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/com/y1ang/controller/PigletController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import com.y1ang.entity.Buy; 4 | import com.y1ang.entity.BuyJson; 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.service.IBatchService; 7 | import com.y1ang.service.IBuyService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author y1ang 18 | * @Data 2018年10月13日-上午10:26:43 19 | * @Description 购买幼猪账单控制类 20 | */ 21 | @Controller 22 | public class PigletController { 23 | 24 | @Autowired 25 | private IBuyService service; 26 | @Autowired 27 | private IBatchService ibs; 28 | 29 | @RequestMapping("/piglet.html") 30 | public String toPigletPage() { 31 | return "piglet.jsp"; 32 | } 33 | 34 | /** 35 | * 显示所有幼猪账单数据 36 | * 37 | * @param limit 38 | * @param page 39 | * @return 40 | */ 41 | @RequestMapping("/pigletrecord") 42 | @ResponseBody 43 | public BuyJson findAllBuyRecord(int limit, int page) { 44 | Page p = new Page((page - 1) * limit, limit); 45 | List allBuyRecord = service.findAllBuyRecord(p); 46 | int count = service.getBuyCount(); 47 | BuyJson json = new BuyJson(0, "200", count, allBuyRecord); 48 | return json; 49 | } 50 | 51 | /** 52 | * 跳转到添加小猪信息界面 53 | * 54 | * @return 55 | */ 56 | @RequestMapping("/addpiglet.html") 57 | public String addPigletRecordPage() { 58 | return "addpiglet.jsp"; 59 | } 60 | 61 | /** 62 | * 添加账单 63 | * 64 | * @param buy 65 | * @return 66 | */ 67 | @RequestMapping("/addpiglet") 68 | @ResponseBody 69 | public String addPigletRecord(Buy buy) { 70 | int batchActive = ibs.getStatusActiveBatchNumber(); 71 | buy.setBatchNumber(batchActive); 72 | System.out.println(buy.getBuyDate()); 73 | int n = service.addBuyRecord(buy); 74 | if (n > 0) { 75 | return "OK"; 76 | } 77 | return "FAIL"; 78 | } 79 | 80 | /** 81 | * 通过id查询幼猪账单信息 82 | * 跳转到更新界面 83 | * 84 | * @param buyID 85 | * @param model 86 | * @return 87 | */ 88 | @RequestMapping("/updatepiglet.html") 89 | public String findBuyRecordByID(int buyID, Model model) { 90 | Buy buyRecordByID = service.findBuyRecordByID(buyID); 91 | model.addAttribute("buy", buyRecordByID); 92 | return "updatepiglet.jsp"; 93 | } 94 | 95 | /** 96 | * 更新账单 97 | * @param buy 98 | * @return 99 | */ 100 | @RequestMapping("/updatepiglet") 101 | @ResponseBody 102 | public String updatePiglet(Buy buy){ 103 | int n = service.updateBuyRecord(buy); 104 | if(n>0){ 105 | return "OK"; 106 | } 107 | return "FAIL"; 108 | } 109 | 110 | /** 111 | * 删除账单 112 | * @param buyID 113 | * @return 114 | */ 115 | @RequestMapping("/deletepiglet") 116 | @ResponseBody 117 | public String deletePigletRecord(int buyID){ 118 | int n = service.deleteBuyRecord(buyID); 119 | if(n>0){ 120 | return "OK"; 121 | } 122 | return "FAIL"; 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/com/y1ang/controller/VaccineController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import com.y1ang.entity.Page; 4 | import com.y1ang.entity.Vaccine; 5 | import com.y1ang.entity.VaccineJson; 6 | import com.y1ang.service.IBatchService; 7 | import com.y1ang.service.IVaccineService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author y1ang 18 | * @Data 2018年10月13日-下午5:44:24 19 | * @Description 疫苗账单控制类 20 | */ 21 | 22 | @Controller 23 | public class VaccineController { 24 | 25 | @Autowired 26 | private IVaccineService service; 27 | @Autowired 28 | private IBatchService batch; 29 | 30 | /** 31 | * 跳转到疫苗账单界面 32 | * 33 | * @return 34 | */ 35 | @RequestMapping("/vaccine.html") 36 | public String toVaccinePage() { 37 | return "vaccine.jsp"; 38 | } 39 | 40 | /** 41 | * 查询所有疫苗账单 42 | * 43 | * @param page 44 | * @param limit 45 | * @return 46 | */ 47 | @RequestMapping("/vaccinerecord") 48 | @ResponseBody 49 | public VaccineJson getAllVaccineRecord(int page, int limit) { 50 | Page p = new Page((page - 1) * limit, limit); 51 | List list = service.findAllVaccine(p); 52 | int activeBatch = batch.getStatusActiveBatchNumber(); 53 | VaccineJson vj = new VaccineJson(0, "200", service.getVaccineCount(activeBatch), list); 54 | return vj; 55 | } 56 | 57 | /** 58 | * 跳转到添加疫苗界面 59 | * 60 | * @return 61 | */ 62 | @RequestMapping("/addvaccine.html") 63 | public String toAddVaccinePage() { 64 | return "addvaccine.jsp"; 65 | } 66 | 67 | /** 68 | * 添加疫苗记录 69 | * 70 | * @param vaccine 71 | * @return 72 | */ 73 | @RequestMapping("/addvaccine") 74 | @ResponseBody 75 | public String addVaccine(Vaccine vaccine) { 76 | vaccine.setBatchNumber(batch.getStatusActiveBatchNumber()); 77 | int n = service.insertVaccineRecord(vaccine); 78 | if (n > 0) { 79 | return "OK"; 80 | } 81 | return "FAIL"; 82 | } 83 | 84 | /** 85 | * 跳转到修改疫苗记录界面 86 | * 87 | * @param vaccineID 88 | * @return 89 | */ 90 | @RequestMapping("/updatevaccine.html") 91 | public String toUpdateVaccinePage(int vaccineID, Model model) { 92 | Vaccine vaccine = service.findVaccineByID(vaccineID); 93 | model.addAttribute("vaccine", vaccine); 94 | return "updatevaccine.jsp"; 95 | } 96 | 97 | /** 98 | * 更新疫苗账单数据 99 | * 100 | * @param vaccine 101 | * @return 102 | */ 103 | @RequestMapping("/updatevaccine") 104 | @ResponseBody 105 | public String updateVaccine(Vaccine vaccine) { 106 | int n = service.updateVaccineRecord(vaccine); 107 | if (n > 0) { 108 | return "OK"; 109 | } 110 | return "FAIL"; 111 | } 112 | 113 | @RequestMapping("/deletevaccine") 114 | @ResponseBody 115 | public String deleteVaccineRecord(int vaccineID) { 116 | int n = service.deleteVaccineRecord(vaccineID); 117 | if (n > 0) { 118 | return "OK"; 119 | } 120 | return "FAIL"; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/SaleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 37 | 38 | 39 | 42 | 43 | 44 | 58 | 59 | 60 | 61 | insert into t_sale 62 | values(0, 63 | #{saleDate}, 64 | #{salePrice}, 65 | #{saleQuantity}, 66 | #{saleVariety}, 67 | #{totalWeight}, 68 | #{averageWeight}, 69 | #{averageMoney}, 70 | #{saleAmount}, 71 | #{batchNumber} 72 | ) 73 | 74 | 75 | 76 | 77 | update 78 | t_sale 79 | set 80 | sale_date = #{saleDate}, 81 | sale_price = #{salePrice}, 82 | sale_quantity = #{saleQuantity}, 83 | sale_variety = #{saleVariety}, 84 | total_weight = #{totalWeight}, 85 | average_weight = #{averageWeight}, 86 | sale_amount = #{saleAmount}, 87 | average_money = #{averageMoney} 88 | where sale_id = #{saleID} 89 | 90 | 91 | 92 | 93 | delete from t_sale where sale_id = #{saleID} 94 | 95 | -------------------------------------------------------------------------------- /src/com/y1ang/controller/CountController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import com.y1ang.entity.ProfitAndLoss; 4 | import com.y1ang.service.IBatchService; 5 | import com.y1ang.service.ICountService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | import java.util.HashMap; 13 | import java.util.Map; 14 | 15 | /** 16 | * @author y1ang 17 | * @Data 2018年10月13日-上午10:22:20 18 | * @Description 19 | */ 20 | @Controller 21 | public class CountController { 22 | 23 | @Autowired 24 | private ICountService service; 25 | @Autowired 26 | private IBatchService ibs; 27 | 28 | private static int active; 29 | 30 | 31 | 32 | /** 33 | * 跳转到统计界面 34 | * @return 35 | */ 36 | @RequestMapping("/count.html") 37 | public String toCountPage(Model model) { 38 | active = ibs.getStatusActiveBatchNumber(); 39 | model.addAttribute("active",active); 40 | return "count.jsp"; 41 | } 42 | 43 | /** 44 | * 盈亏账单 45 | * @return 46 | */ 47 | @RequestMapping("/profitChart") 48 | @ResponseBody 49 | public ProfitAndLoss profitAndLossChart(){ 50 | ProfitAndLoss profitAndLoss = service.getProfitAndLoss(active); 51 | return profitAndLoss; 52 | } 53 | 54 | /** 55 | * 饲料账单统计 56 | * @return 57 | */ 58 | @RequestMapping("/feedChart") 59 | @ResponseBody 60 | public Map feedChart() { 61 | Map map = new HashMap(6); 62 | map.put("feedPaid", service.getPaidFeedAmount(active)); 63 | map.put("feedUnPaid", service.getUnPaidFeedAmount(active)); 64 | map.put("feedTotal", service.getAllFeedAmount(active)); 65 | map.put("moneyPaid", service.getPaidMoney(active)); 66 | map.put("moneyUnPaid", service.getUnPaidMoney(active)); 67 | map.put("moneyTotal", service.getFeedMoney(active)); 68 | return map; 69 | } 70 | 71 | /** 72 | * 小猪明细统计 73 | * @return 74 | */ 75 | @RequestMapping("/pigletChart") 76 | @ResponseBody 77 | public Map pigletChart() { 78 | Map map = new HashMap<>(2); 79 | map.put("pigletChart", service.getPigletMoney(active)); 80 | return map; 81 | } 82 | 83 | /** 84 | * 卖猪详情统计 85 | * @return 86 | */ 87 | @RequestMapping("/saleChart") 88 | @ResponseBody 89 | public Map saleChart() { 90 | Map map = new HashMap<>(2); 91 | map.put("saleChart", service.getSaleMoney(active)); 92 | return map; 93 | } 94 | 95 | /** 96 | * 疫苗账单统计 97 | * @return 98 | */ 99 | @RequestMapping("/vaccineChart") 100 | @ResponseBody 101 | public Map vaccineChart(){ 102 | Map map = new HashMap<>(2); 103 | map.put("vaccineTotal",service.getVaccineMoney(active)); 104 | return map; 105 | } 106 | 107 | /** 108 | * 其他收支统计 109 | * @return 110 | */ 111 | @RequestMapping("/otherChart") 112 | @ResponseBody 113 | public Map otherChart(){ 114 | Map map = new HashMap<>(2); 115 | map.put("otherChart",service.getOtherMoney(active)); 116 | return map; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /src/com/y1ang/mapper/CountMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 20 | 21 | 22 | 25 | 26 | 27 | 30 | 31 | 32 | 35 | 36 | 37 | 40 | 41 | 42 | 45 | 46 | 47 | 50 | 51 | 52 | 55 | 56 | 57 | 60 | 61 | 62 | 65 | 66 | 67 | 70 | 71 | -------------------------------------------------------------------------------- /web/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
      ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
    "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a";*/ 169 | /*font-size: 20px;*/ 170 | /*position: absolute;*/ 171 | /*top: 10px;*/ 172 | /*right: 0px;*/ 173 | /*color: #c9c9c9;*/ 174 | /*}*/ 175 | .more-set .border{ 176 | border-bottom: 1px solid #f3f3f3; 177 | } 178 | #switch-item{ 179 | display: none; 180 | padding: 25px 5px; 181 | box-sizing: border-box; 182 | } -------------------------------------------------------------------------------- /src/com/y1ang/controller/FeedController.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.controller; 2 | 3 | import com.y1ang.entity.Feed; 4 | import com.y1ang.entity.FeedJson; 5 | import com.y1ang.entity.Page; 6 | import com.y1ang.service.IBatchService; 7 | import com.y1ang.service.IFeedService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * 饲料账单控制类 18 | * 19 | * @author y1ang 20 | * @Data 2018年8月27日-上午1:04:21 21 | * @Description 饲料账单控制类 22 | */ 23 | @Controller 24 | public class FeedController { 25 | 26 | @Autowired 27 | private IFeedService service; 28 | 29 | @Autowired 30 | private IBatchService ibs; 31 | 32 | /** 33 | * 跳转到饲料账单界面 34 | * 35 | * @return 36 | */ 37 | @RequestMapping("/feed.html") 38 | public String toFeedPage() { 39 | return "feed.jsp"; 40 | } 41 | 42 | /** 43 | * 显示饲料账单数据 44 | * 45 | * @param page 46 | * @param limit 47 | * @return 48 | */ 49 | @RequestMapping("/feedrecord") 50 | @ResponseBody 51 | public FeedJson getFeedRecord(int page, int limit) { 52 | FeedJson fj = new FeedJson(); 53 | Page p = new Page((page - 1) * limit, limit); 54 | List feedRecord = service.findFeedRecord(p); 55 | int activeBatch = ibs.getStatusActiveBatchNumber(); 56 | fj.setCode(0); 57 | fj.setCount(service.getFeedCount(activeBatch)); 58 | fj.setMsg("200"); 59 | fj.setData(feedRecord); 60 | return fj; 61 | } 62 | /** 63 | * 跳转到添加饲料账单界面 64 | * 65 | * @return 66 | */ 67 | @RequestMapping("/addfeed.html") 68 | public String toAddPage() { 69 | return "addfeed.jsp"; 70 | } 71 | 72 | /** 73 | * 添加饲料账单记录 74 | * 75 | * @param feed 76 | * @return 77 | */ 78 | @RequestMapping("/addfeed") 79 | @ResponseBody 80 | public String addFeedRecord(Feed feed) { 81 | try { 82 | int batchNumber = ibs.getStatusActiveBatchNumber(); 83 | feed.setBatchNumber(batchNumber); 84 | feed.setFeedTotal(feed.getFeedQuantity() * feed.getFeedPrice()); 85 | int n = service.addFeedRecord(feed); 86 | if (n > 0) { 87 | return "OK"; 88 | } 89 | } catch (NumberFormatException e) { 90 | e.printStackTrace(); 91 | } 92 | return "FAIl"; 93 | } 94 | 95 | /** 96 | * 删除饲料账单记录 97 | * 98 | * @param feedID 99 | * @return 100 | */ 101 | @RequestMapping("/deletefeed") 102 | @ResponseBody 103 | public String deleteFeedRecord(int feedID) { 104 | int n = service.deleteFeedRecord(feedID); 105 | if (n > 0) { 106 | return "OK"; 107 | } 108 | return "FAIL"; 109 | } 110 | 111 | /** 112 | * 跳转到饲料账单修改界面 113 | * 114 | * @param feedID 115 | * @param model 116 | * @return 117 | */ 118 | @RequestMapping("/updatefeed.html") 119 | public String toUpdatePage(int feedID, Model model) { 120 | Feed feed = service.findFeedRecordByID(feedID); 121 | model.addAttribute("feed", feed); 122 | return "updatefeed.jsp"; 123 | } 124 | 125 | /** 126 | * 更新饲料账单 127 | * 128 | * @param feed 129 | * @return 130 | */ 131 | @RequestMapping("/updatefeed") 132 | @ResponseBody 133 | public String updateFeed(Feed feed) { 134 | feed.setFeedTotal(feed.getFeedQuantity() * feed.getFeedPrice()); 135 | int n = service.updateFeedRecord(feed); 136 | if (n > 0) { 137 | return "OK"; 138 | } 139 | return "FAIL"; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /web/js/count.js: -------------------------------------------------------------------------------- 1 | layui.use(['element', 'table', 'layer'], function () { 2 | var element = layui.element, 3 | $ = layui.jquery, 4 | table = layui.table, 5 | layer = layui.layer; 6 | 7 | element.init(); 8 | 9 | $(function () { 10 | 11 | /*盈亏账单*/ 12 | $.ajax({ 13 | url:"profitChart", 14 | dataType:"json", 15 | type:"post", 16 | success:function (data) { 17 | var d = new Array(); 18 | d.push(data.income); 19 | d.push(data.expend); 20 | d.push(data.profit); 21 | draw(d); 22 | $(".profitChart").append(""+data.income+" 元"+data.expend+" 元"+data.profit+" 元") 23 | } 24 | }); 25 | 26 | /*饲料账单*/ 27 | $.ajax({ 28 | url: "feedChart", 29 | dataType: "json", 30 | type: "json", 31 | success: function (data) { 32 | $(".feedChart").append(("饲料已支付" + data.feedPaid + " 包")); 33 | $(".feedChart").append(("饲料未支付" + data.feedUnPaid + " 包")); 34 | $(".feedChart").append(("饲料总数量" + data.feedTotal + " 包")); 35 | $(".feedChart").append("
    "); 36 | $(".feedChart").append(("金额已支付" + data.moneyPaid + " 元")); 37 | $(".feedChart").append(("金额未支付" + data.moneyUnPaid + " 元")); 38 | $(".feedChart").append(("金额总数" + data.moneyTotal + " 元")); 39 | } 40 | }); 41 | 42 | /*小猪账单*/ 43 | $.ajax({ 44 | url: "pigletChart", 45 | dataType: "json", 46 | type: "post", 47 | success: function (data) { 48 | $(".pigletChart").append("买猪合计" + data.pigletChart + " 元") 49 | } 50 | }); 51 | /*卖猪账单*/ 52 | $.ajax({ 53 | url: "saleChart", 54 | dataType: "json", 55 | type: "post", 56 | success: function (data) { 57 | $(".saleChart").append("卖猪合计" + data.saleChart + " 元") 58 | } 59 | }); 60 | 61 | /*疫苗账单*/ 62 | $.ajax({ 63 | url: "vaccineChart", 64 | dataType: "json", 65 | type: "post", 66 | success: function (data) { 67 | $(".vaccineChart").append("疫苗开销" + data.vaccineTotal + " 元") 68 | } 69 | }); 70 | 71 | /*其他账单*/ 72 | $.ajax({ 73 | url: "otherChart", 74 | dataType: "json", 75 | type: "post", 76 | success: function (data) { 77 | $(".otherChart").append("其他支出" + data.otherChart + " 元") 78 | } 79 | }); 80 | }); 81 | 82 | function draw(data) { 83 | var profit = document.getElementById("profit").getContext('2d'); 84 | var chart_profit = new Chart(profit, { 85 | type: 'bar', 86 | data: { 87 | labels: [ "收入","支出", "盈亏"], 88 | datasets: [{ 89 | label: '盈亏状态图', 90 | data: data, 91 | backgroundColor: [ 92 | 'rgba(255, 99, 132, 0.2)', 93 | 'rgba(75, 192, 192, 0.2)', 94 | 'rgba(255, 206, 86, 0.2)' 95 | ], 96 | borderColor: [ 97 | 'rgba(255,99,132,1)', 98 | 'rgba(54, 162, 235, 1)', 99 | 'rgba(255, 206, 86, 1)' 100 | ], 101 | borderWidth: 2 102 | }] 103 | } 104 | }); 105 | } 106 | }); -------------------------------------------------------------------------------- /web/css/404.css: -------------------------------------------------------------------------------- 1 | .error .clip .shadow { 2 | height: 180px; 3 | } 4 | 5 | .error .clip:nth-of-type(2) .shadow { 6 | width: 130px; 7 | } 8 | 9 | .error .clip:nth-of-type(1) .shadow, 10 | .error .clip:nth-of-type(3) .shadow { 11 | width: 250px; 12 | } 13 | 14 | .error .digit { 15 | width: 150px; 16 | height: 150px; 17 | line-height: 150px; 18 | font-size: 120px; 19 | font-weight: bold; 20 | } 21 | 22 | .error h2 { 23 | font-size: 32px; 24 | } 25 | 26 | .error .msg { 27 | top: -190px; 28 | left: 30%; 29 | width: 80px; 30 | height: 80px; 31 | line-height: 80px; 32 | font-size: 32px; 33 | } 34 | 35 | .error span.triangle { 36 | top: 70%; 37 | right: 0%; 38 | border-left: 20px solid #535353; 39 | border-top: 15px solid transparent; 40 | border-bottom: 15px solid transparent; 41 | } 42 | 43 | .error .container-error-404 { 44 | margin-top: 10%; 45 | position: relative; 46 | height: 250px; 47 | padding-top: 40px; 48 | } 49 | 50 | .error .container-error-404 .clip { 51 | display: inline-block; 52 | transform: skew(-45deg); 53 | } 54 | 55 | .error .clip .shadow { 56 | overflow: hidden; 57 | } 58 | 59 | .error .clip:nth-of-type(2) .shadow { 60 | overflow: hidden; 61 | position: relative; 62 | box-shadow: inset 20px 0px 20px -15px rgba(150, 150, 150, 0.8), 20px 0px 20px -15px rgba(150, 150, 150, 0.8); 63 | } 64 | 65 | .error .clip:nth-of-type(3) .shadow:after, 66 | .error .clip:nth-of-type(1) .shadow:after { 67 | content: ""; 68 | position: absolute; 69 | right: -8px; 70 | bottom: 0px; 71 | z-index: 9999; 72 | height: 100%; 73 | width: 10px; 74 | background: linear-gradient(90deg, transparent, rgba(173, 173, 173, 0.8), transparent); 75 | border-radius: 50%; 76 | } 77 | 78 | .error .clip:nth-of-type(3) .shadow:after { 79 | left: -8px; 80 | } 81 | 82 | .error .digit { 83 | position: relative; 84 | top: 8%; 85 | color: white; 86 | background: #07B3F9; 87 | border-radius: 50%; 88 | display: inline-block; 89 | transform: skew(45deg); 90 | } 91 | 92 | .error .clip:nth-of-type(2) .digit { 93 | left: -10%; 94 | } 95 | 96 | .error .clip:nth-of-type(1) .digit { 97 | right: -20%; 98 | } 99 | 100 | .error .clip:nth-of-type(3) .digit { 101 | left: -20%; 102 | } 103 | 104 | .error h2 { 105 | font-size: 24px; 106 | color: #A2A2A2; 107 | font-weight: bold; 108 | padding-bottom: 20px; 109 | } 110 | 111 | .error .tohome { 112 | font-size: 16px; 113 | color: #07B3F9; 114 | } 115 | 116 | .error .msg { 117 | position: relative; 118 | z-index: 9999; 119 | display: block; 120 | background: #535353; 121 | color: #A2A2A2; 122 | border-radius: 50%; 123 | font-style: italic; 124 | } 125 | 126 | .error .triangle { 127 | position: absolute; 128 | z-index: 999; 129 | transform: rotate(45deg); 130 | content: ""; 131 | width: 0; 132 | height: 0; 133 | } 134 | 135 | @media(max-width: 767px) { 136 | .error .clip .shadow { 137 | height: 100px; 138 | } 139 | .error .clip:nth-of-type(2) .shadow { 140 | width: 80px; 141 | } 142 | .error .clip:nth-of-type(1) .shadow, 143 | .error .clip:nth-of-type(3) .shadow { 144 | width: 100px; 145 | } 146 | .error .digit { 147 | width: 80px; 148 | height: 80px; 149 | line-height: 80px; 150 | font-size: 52px; 151 | } 152 | .error h2 { 153 | font-size: 18px; 154 | } 155 | .error .msg { 156 | top: -110px; 157 | left: 15%; 158 | width: 40px; 159 | height: 40px; 160 | line-height: 40px; 161 | font-size: 18px; 162 | } 163 | .error span.triangle { 164 | top: 70%; 165 | right: -3%; 166 | border-left: 10px solid #535353; 167 | border-top: 8px solid transparent; 168 | border-bottom: 8px solid transparent; 169 | } 170 | .error .container-error-404 { 171 | height: 150px; 172 | } 173 | } -------------------------------------------------------------------------------- /web/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.3 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /src/com/y1ang/util/GetNewsUtil.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.util; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.io.InputStreamReader; 7 | import java.net.URL; 8 | import java.net.URLConnection; 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | import java.util.regex.Matcher; 12 | import java.util.regex.Pattern; 13 | 14 | /** 15 | * 16 | * @author y1ang 17 | * @Data 2018年9月10日-下午9:05:12 18 | * @Description 获取网页数据 19 | */ 20 | public class GetNewsUtil { 21 | /** 22 | * 获取源代码 23 | * 24 | * @param url 25 | * @return 26 | */ 27 | public static String getSources(String url) { 28 | InputStream in = null; 29 | InputStreamReader isr = null; 30 | BufferedReader br = null; 31 | StringBuilder sb = new StringBuilder(); 32 | try { 33 | URL u = new URL(url); 34 | URLConnection connection = u.openConnection(); 35 | connection.setRequestProperty("User-Agent", 36 | "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36"); 37 | in = connection.getInputStream(); 38 | isr = new InputStreamReader(in, "UTF8"); 39 | br = new BufferedReader(isr); 40 | String line = ""; 41 | while ((line = br.readLine()) != null) { 42 | sb.append(line); 43 | } 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } finally { 47 | if (br != null) { 48 | try { 49 | br.close(); 50 | } catch (IOException e) { 51 | e.printStackTrace(); 52 | } 53 | } 54 | if (isr != null) { 55 | try { 56 | isr.close(); 57 | } catch (IOException e) { 58 | e.printStackTrace(); 59 | } 60 | } 61 | if (in != null) { 62 | try { 63 | in.close(); 64 | } catch (IOException e) { 65 | e.printStackTrace(); 66 | } 67 | } 68 | } 69 | return sb.toString(); 70 | } 71 | 72 | /** 73 | * 获取标题和URL 74 | * 75 | * @return 76 | */ 77 | public static List> getItem() { 78 | String reqUrl = "https://www.zhuwang.cc/"; 79 | String resource = GetNewsUtil.getSources(reqUrl); 80 | List> result = new ArrayList<>(); 81 | List hrefList = new ArrayList<>(); 82 | List titleList = new ArrayList<>(); 83 | String reg = "
    (.*?)
    "; 84 | Matcher matcher = Pattern.compile(reg).matcher(resource.toString()); 85 | if (matcher.find()) { 86 | // 获取地址 87 | String regURL = "href=\".*?\""; 88 | Matcher matcherURL = Pattern.compile(regURL).matcher(matcher.group()); 89 | while (matcherURL.find()) { 90 | hrefList.add(matcherURL.group().replace("href=\"//", "").replace("\"", "")); 91 | } 92 | // 获取标题 93 | String regTitle = "title=\".*?\""; 94 | Matcher matcherTitle = Pattern.compile(regTitle).matcher(matcher.group()); 95 | while (matcherTitle.find()) { 96 | titleList.add(matcherTitle.group().replace("title=\"", "").replace("\"", "")); 97 | } 98 | } 99 | result.add(titleList); 100 | result.add(hrefList); 101 | return result; 102 | } 103 | 104 | /** 105 | * 获取各条新闻详情 106 | * 107 | * @param url 108 | * @return 109 | */ 110 | public static String getItemContent(String url) { 111 | String sources = GetNewsUtil.getSources(url); 112 | String reg = "
    (.*?)
    |
    (.*?)
    "; 113 | Matcher matcher = Pattern.compile(reg).matcher(sources); 114 | StringBuilder sb = new StringBuilder(); 115 | while (matcher.find()) { 116 | sb.append(matcher.group()); 117 | } 118 | return sb.toString(); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Buy.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * @author y1ang 5 | * @Data 2018年10月17日-下午4:28:42 6 | * @Description 购买幼猪实体类 7 | */ 8 | public class Buy { 9 | /** 10 | * 购买ID 11 | */ 12 | private int buyID; 13 | /** 14 | * 购买日期 15 | */ 16 | private String buyDate; 17 | /** 18 | * 购买数量 19 | */ 20 | private int buyQuantity; 21 | /** 22 | * 购买品种 23 | */ 24 | private String buyVariety; 25 | /** 26 | * 购买价格 27 | */ 28 | private double buyPrice; 29 | /** 30 | * 购买地址 31 | */ 32 | private String buyAddress; 33 | /** 34 | * 平均重量 35 | */ 36 | private double averageWeight; 37 | /** 38 | * 超出标准重量价格 39 | */ 40 | private double beyondPrice; 41 | /** 42 | * 购买总金额 43 | */ 44 | private double totalMoney; 45 | /** 46 | * 批次号 47 | */ 48 | private int batchNumber; 49 | 50 | public int getBuyID() { 51 | return buyID; 52 | } 53 | 54 | public void setBuyID(int buyID) { 55 | this.buyID = buyID; 56 | } 57 | 58 | public String getBuyDate() { 59 | return buyDate; 60 | } 61 | 62 | public void setBuyDate(String buyDate) { 63 | this.buyDate = buyDate; 64 | } 65 | 66 | public int getBuyQuantity() { 67 | return buyQuantity; 68 | } 69 | 70 | public void setBuyQuantity(int buyQuantity) { 71 | this.buyQuantity = buyQuantity; 72 | } 73 | 74 | public String getBuyVariety() { 75 | return buyVariety; 76 | } 77 | 78 | public void setBuyVariety(String buyVariety) { 79 | this.buyVariety = buyVariety; 80 | } 81 | 82 | public double getBuyPrice() { 83 | return buyPrice; 84 | } 85 | 86 | public void setBuyPrice(double buyPrice) { 87 | this.buyPrice = buyPrice; 88 | } 89 | 90 | public String getBuyAddress() { 91 | return buyAddress; 92 | } 93 | 94 | public void setBuyAddress(String buyAddress) { 95 | this.buyAddress = buyAddress; 96 | } 97 | 98 | public double getAverageWeight() { 99 | return averageWeight; 100 | } 101 | 102 | public void setAverageWeight(double averageWeight) { 103 | this.averageWeight = averageWeight; 104 | } 105 | 106 | public double getBeyondPrice() { 107 | return beyondPrice; 108 | } 109 | 110 | public void setBeyondPrice(double beyondPrice) { 111 | this.beyondPrice = beyondPrice; 112 | } 113 | 114 | public double getTotalMoney() { 115 | return totalMoney; 116 | } 117 | 118 | public void setTotalMoney(double totalMoney) { 119 | this.totalMoney = totalMoney; 120 | } 121 | 122 | public int getBatchNumber() { 123 | return batchNumber; 124 | } 125 | 126 | public void setBatchNumber(int batchNumber) { 127 | this.batchNumber = batchNumber; 128 | } 129 | 130 | public Buy(int buyID, String buyDate, int buyQuantity, String buyVariety, double buyPrice, String buyAddress, 131 | double averageWeight, double beyondPrice, double totalMoney, int batchNumber) { 132 | super(); 133 | this.buyID = buyID; 134 | this.buyDate = buyDate; 135 | this.buyQuantity = buyQuantity; 136 | this.buyVariety = buyVariety; 137 | this.buyPrice = buyPrice; 138 | this.buyAddress = buyAddress; 139 | this.averageWeight = averageWeight; 140 | this.beyondPrice = beyondPrice; 141 | this.totalMoney = totalMoney; 142 | this.batchNumber = batchNumber; 143 | } 144 | 145 | public Buy(String buyDate, int buyQuantity, String buyVariety, double buyPrice, String buyAddress, 146 | double averageWeight, double beyondPrice, double totalMoney, int batchNumber) { 147 | super(); 148 | this.buyDate = buyDate; 149 | this.buyQuantity = buyQuantity; 150 | this.buyVariety = buyVariety; 151 | this.buyPrice = buyPrice; 152 | this.buyAddress = buyAddress; 153 | this.averageWeight = averageWeight; 154 | this.beyondPrice = beyondPrice; 155 | this.totalMoney = totalMoney; 156 | this.batchNumber = batchNumber; 157 | } 158 | 159 | public Buy() { 160 | super(); 161 | } 162 | 163 | } 164 | -------------------------------------------------------------------------------- /src/com/y1ang/entity/Sale.java: -------------------------------------------------------------------------------- 1 | package com.y1ang.entity; 2 | 3 | /** 4 | * 5 | * @author y1ang 6 | * @Data 2018年10月14日-下午2:30:30 7 | * @Description 销售生猪实体类 8 | */ 9 | public class Sale { 10 | /** 11 | * 销售id 12 | */ 13 | private int saleID; 14 | /** 15 | * 销售日期 16 | */ 17 | private String saleDate; 18 | /** 19 | * 销售价格 20 | */ 21 | private double salePrice; 22 | /** 23 | * 销售数量 24 | */ 25 | private int saleQuantity; 26 | /** 27 | * 销售品种 28 | */ 29 | private String saleVariety; 30 | /** 31 | * 销售总重量 32 | */ 33 | private double totalWeight; 34 | /** 35 | * 平均重量 36 | */ 37 | private double averageWeight; 38 | /** 39 | * 销售总金额 40 | */ 41 | private double saleAmount; 42 | /** 43 | * 平均每头金额 44 | */ 45 | private double averageMoney; 46 | /** 47 | * 批次号 48 | */ 49 | private int batchNumber; 50 | 51 | public int getSaleID() { 52 | return saleID; 53 | } 54 | 55 | public void setSaleID(int saleID) { 56 | this.saleID = saleID; 57 | } 58 | 59 | public String getSaleDate() { 60 | return saleDate; 61 | } 62 | 63 | public void setSaleDate(String saleDate) { 64 | this.saleDate = saleDate; 65 | } 66 | 67 | public double getSalePrice() { 68 | return salePrice; 69 | } 70 | 71 | public void setSalePrice(double salePrice) { 72 | this.salePrice = salePrice; 73 | } 74 | 75 | public int getSaleQuantity() { 76 | return saleQuantity; 77 | } 78 | 79 | public void setSaleQuantity(int saleQuantity) { 80 | this.saleQuantity = saleQuantity; 81 | } 82 | 83 | public String getSaleVariety() { 84 | return saleVariety; 85 | } 86 | 87 | public void setSaleVariety(String saleVariety) { 88 | this.saleVariety = saleVariety; 89 | } 90 | 91 | public double getTotalWeight() { 92 | return totalWeight; 93 | } 94 | 95 | public void setTotalWeight(double totalWeight) { 96 | this.totalWeight = totalWeight; 97 | } 98 | 99 | public double getAverageWeight() { 100 | return averageWeight; 101 | } 102 | 103 | public void setAverageWeight(double averageWeight) { 104 | this.averageWeight = averageWeight; 105 | } 106 | 107 | public double getSaleAmount() { 108 | return saleAmount; 109 | } 110 | 111 | public void setSaleAmount(double saleAmount) { 112 | this.saleAmount = saleAmount; 113 | } 114 | 115 | public double getAverageMoney() { 116 | return averageMoney; 117 | } 118 | 119 | public void setAverageMoney(double averageMoney) { 120 | this.averageMoney = averageMoney; 121 | } 122 | 123 | public int getBatchNumber() { 124 | return batchNumber; 125 | } 126 | 127 | public void setBatchNumber(int batchNumber) { 128 | this.batchNumber = batchNumber; 129 | } 130 | 131 | public Sale(int saleID, String saleDate, double salePrice, int saleQuantity, String saleVariety, double totalWeight, 132 | double averageWeight, double saleAmount, double averageMoney, int batchNumber) { 133 | super(); 134 | this.saleID = saleID; 135 | this.saleDate = saleDate; 136 | this.salePrice = salePrice; 137 | this.saleQuantity = saleQuantity; 138 | this.saleVariety = saleVariety; 139 | this.totalWeight = totalWeight; 140 | this.averageWeight = averageWeight; 141 | this.saleAmount = saleAmount; 142 | this.averageMoney = averageMoney; 143 | this.batchNumber = batchNumber; 144 | } 145 | 146 | public Sale(String saleDate, double salePrice, int saleQuantity, String saleVariety, double totalWeight, 147 | double averageWeight, double saleAmount, double averageMoney, int batchNumber) { 148 | super(); 149 | this.saleDate = saleDate; 150 | this.salePrice = salePrice; 151 | this.saleQuantity = saleQuantity; 152 | this.saleVariety = saleVariety; 153 | this.totalWeight = totalWeight; 154 | this.averageWeight = averageWeight; 155 | this.saleAmount = saleAmount; 156 | this.averageMoney = averageMoney; 157 | this.batchNumber = batchNumber; 158 | } 159 | 160 | public Sale() { 161 | super(); 162 | } 163 | 164 | } 165 | --------------------------------------------------------------------------------