diff --git a/pom.xml b/pom.xml index 5c922b3..b1e9417 100644 --- a/pom.xml +++ b/pom.xml @@ -217,6 +217,11 @@ zhyc-common ${zhyc.version} + + zhyc + zhyc-module + ${zhyc.version} + diff --git a/ry.bat b/ry.bat deleted file mode 100644 index 7b9da84..0000000 --- a/ry.bat +++ /dev/null @@ -1,67 +0,0 @@ -@echo off - -rem jar平级目录 -set AppName=zhyc-admin.jar - -rem JVM参数 -set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" - - -ECHO. - ECHO. [1] 启动%AppName% - ECHO. [2] 关闭%AppName% - ECHO. [3] 重启%AppName% - ECHO. [4] 启动状态 %AppName% - ECHO. [5] 退 出 -ECHO. - -ECHO.请输入选择项目的序号: -set /p ID= - IF "%id%"=="1" GOTO start - IF "%id%"=="2" GOTO stop - IF "%id%"=="3" GOTO restart - IF "%id%"=="4" GOTO status - IF "%id%"=="5" EXIT -PAUSE -:start - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if defined pid ( - echo %%is running - PAUSE - ) - -start javaw %JVM_OPTS% -jar %AppName% - -echo starting…… -echo Start %AppName% success... -goto:eof - -rem 函数stop通过jps命令查找pid并结束进程 -:stop - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if not defined pid (echo process %AppName% does not exists) else ( - echo prepare to kill %image_name% - echo start kill %pid% ... - rem 根据进程ID,kill进程 - taskkill /f /pid %pid% - ) -goto:eof -:restart - call :stop - call :start -goto:eof -:status - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if not defined pid (echo process %AppName% is dead ) else ( - echo %image_name% is running - ) -goto:eof diff --git a/ry.sh b/ry.sh deleted file mode 100644 index a47d0e5..0000000 --- a/ry.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh -# ./ry.sh start 鍚姩 stop 鍋滄 restart 閲嶅惎 status 鐘舵 -AppName=zhyc-admin.jar - -# JVM鍙傛暟 -JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" -APP_HOME=`pwd` -LOG_PATH=$APP_HOME/logs/$AppName.log - -if [ "$1" = "" ]; -then - echo -e "\033[0;31m 鏈緭鍏ユ搷浣滃悕 \033[0m \033[0;34m {start|stop|restart|status} \033[0m" - exit 1 -fi - -if [ "$AppName" = "" ]; -then - echo -e "\033[0;31m 鏈緭鍏ュ簲鐢ㄥ悕 \033[0m" - exit 1 -fi - -function start() -{ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - - if [ x"$PID" != x"" ]; then - echo "$AppName is running..." - else - nohup java $JVM_OPTS -jar $AppName > /dev/null 2>&1 & - echo "Start $AppName success..." - fi -} - -function stop() -{ - echo "Stop $AppName" - - PID="" - query(){ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - } - - query - if [ x"$PID" != x"" ]; then - kill -TERM $PID - echo "$AppName (pid:$PID) exiting..." - while [ x"$PID" != x"" ] - do - sleep 1 - query - done - echo "$AppName exited." - else - echo "$AppName already stopped." - fi -} - -function restart() -{ - stop - sleep 2 - start -} - -function status() -{ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` - if [ $PID != 0 ];then - echo "$AppName is running..." - else - echo "$AppName is not running..." - fi -} - -case $1 in - start) - start;; - stop) - stop;; - restart) - restart;; - status) - status;; - *) - -esac diff --git a/zhyc-admin/pom.xml b/zhyc-admin/pom.xml index f6be6ad..eb68fae 100644 --- a/zhyc-admin/pom.xml +++ b/zhyc-admin/pom.xml @@ -61,6 +61,13 @@ zhyc-generator + + + + zhyc + zhyc-module + + diff --git a/zhyc-admin/src/main/java/com/zhyc/SheepApplication.java b/zhyc-admin/src/main/java/com/zhyc/SheepApplication.java index ec34567..1867b29 100644 --- a/zhyc-admin/src/main/java/com/zhyc/SheepApplication.java +++ b/zhyc-admin/src/main/java/com/zhyc/SheepApplication.java @@ -3,6 +3,7 @@ package com.zhyc; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; /** * 鍚姩绋嬪簭 diff --git a/zhyc-module/pom.xml b/zhyc-module/pom.xml index 756defb..a7beefd 100644 --- a/zhyc-module/pom.xml +++ b/zhyc-module/pom.xml @@ -2,14 +2,21 @@ - 4.0.0 + zhyc zhyc 3.8.9 + 4.0.0 zhyc-module + + + zhyc + zhyc-common + + \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/controller/ScCastrateController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/controller/ScCastrateController.java new file mode 100644 index 0000000..d14f446 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/controller/ScCastrateController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.produce.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.produce.domain.ScCastrate; +import com.zhyc.module.produce.service.IScCastrateService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 鍘诲娍Controller + * + * @author ruoyi + * @date 2025-07-09 + */ +@RestController +@RequestMapping("/produce/castrate") +public class ScCastrateController extends BaseController +{ + @Autowired + private IScCastrateService scCastrateService; + + /** + * 鏌ヨ鍘诲娍鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:list')") + @GetMapping("/list") + public TableDataInfo list(ScCastrate scCastrate) + { + startPage(); + List list = scCastrateService.selectScCastrateList(scCastrate); + return getDataTable(list); + } + + /** + * 瀵煎嚭鍘诲娍鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:export')") + @Log(title = "鍘诲娍", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScCastrate scCastrate) + { + List list = scCastrateService.selectScCastrateList(scCastrate); + ExcelUtil util = new ExcelUtil(ScCastrate.class); + util.exportExcel(response, list, "鍘诲娍鏁版嵁"); + } + + /** + * 鑾峰彇鍘诲娍璇︾粏淇℃伅 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(scCastrateService.selectScCastrateById(id)); + } + + /** + * 鏂板鍘诲娍 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:add')") + @Log(title = "鍘诲娍", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ScCastrate scCastrate) + { + return toAjax(scCastrateService.insertScCastrate(scCastrate)); + } + + /** + * 淇敼鍘诲娍 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:edit')") + @Log(title = "鍘诲娍", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ScCastrate scCastrate) + { + return toAjax(scCastrateService.updateScCastrate(scCastrate)); + } + + /** + * 鍒犻櫎鍘诲娍 + */ + @PreAuthorize("@ss.hasPermi('produce:castrate:remove')") + @Log(title = "鍘诲娍", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(scCastrateService.deleteScCastrateByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/domain/ScCastrate.java b/zhyc-module/src/main/java/com/zhyc/module/produce/domain/ScCastrate.java new file mode 100644 index 0000000..fae976c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/domain/ScCastrate.java @@ -0,0 +1,99 @@ +package com.zhyc.module.produce.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 鍘诲娍瀵硅薄 sc_castrate + * + * @author ruoyi + * @date 2025-07-09 + */ +public class ScCastrate extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 缇婂彧id */ + @Excel(name = "缇婂彧id") + private String sheepId; + + /** 缇婅垗id */ + @Excel(name = "缇婅垗id") + private Long sheepfold; + + /** 澶囨敞 */ + @Excel(name = "澶囨敞") + private String comment; + + /** 鎶鏈憳 */ + @Excel(name = "鎶鏈憳") + private String technician; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setSheepId(String sheepId) + { + this.sheepId = sheepId; + } + + public String getSheepId() + { + return sheepId; + } + + public void setSheepfold(Long sheepfold) + { + this.sheepfold = sheepfold; + } + + public Long getSheepfold() + { + return sheepfold; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + public void setTechnician(String technician) + { + this.technician = technician; + } + + public String getTechnician() + { + return technician; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sheepId", getSheepId()) + .append("sheepfold", getSheepfold()) + .append("comment", getComment()) + .append("technician", getTechnician()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/mapper/ScCastrateMapper.java b/zhyc-module/src/main/java/com/zhyc/module/produce/mapper/ScCastrateMapper.java new file mode 100644 index 0000000..16a27e7 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/mapper/ScCastrateMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.mapper; + +import java.util.List; +import com.zhyc.module.produce.domain.ScCastrate; + +/** + * 鍘诲娍Mapper鎺ュ彛 + * + * @author ruoyi + * @date 2025-07-09 + */ +public interface ScCastrateMapper +{ + /** + * 鏌ヨ鍘诲娍 + * + * @param id 鍘诲娍涓婚敭 + * @return 鍘诲娍 + */ + public ScCastrate selectScCastrateById(Long id); + + /** + * 鏌ヨ鍘诲娍鍒楄〃 + * + * @param scCastrate 鍘诲娍 + * @return 鍘诲娍闆嗗悎 + */ + public List selectScCastrateList(ScCastrate scCastrate); + + /** + * 鏂板鍘诲娍 + * + * @param scCastrate 鍘诲娍 + * @return 缁撴灉 + */ + public int insertScCastrate(ScCastrate scCastrate); + + /** + * 淇敼鍘诲娍 + * + * @param scCastrate 鍘诲娍 + * @return 缁撴灉 + */ + public int updateScCastrate(ScCastrate scCastrate); + + /** + * 鍒犻櫎鍘诲娍 + * + * @param id 鍘诲娍涓婚敭 + * @return 缁撴灉 + */ + public int deleteScCastrateById(Long id); + + /** + * 鎵归噺鍒犻櫎鍘诲娍 + * + * @param ids 闇瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteScCastrateByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/service/IScCastrateService.java b/zhyc-module/src/main/java/com/zhyc/module/produce/service/IScCastrateService.java new file mode 100644 index 0000000..7abd510 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/service/IScCastrateService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.produce.service; + +import java.util.List; +import com.zhyc.module.produce.domain.ScCastrate; + +/** + * 鍘诲娍Service鎺ュ彛 + * + * @author ruoyi + * @date 2025-07-09 + */ +public interface IScCastrateService +{ + /** + * 鏌ヨ鍘诲娍 + * + * @param id 鍘诲娍涓婚敭 + * @return 鍘诲娍 + */ + public ScCastrate selectScCastrateById(Long id); + + /** + * 鏌ヨ鍘诲娍鍒楄〃 + * + * @param scCastrate 鍘诲娍 + * @return 鍘诲娍闆嗗悎 + */ + public List selectScCastrateList(ScCastrate scCastrate); + + /** + * 鏂板鍘诲娍 + * + * @param scCastrate 鍘诲娍 + * @return 缁撴灉 + */ + public int insertScCastrate(ScCastrate scCastrate); + + /** + * 淇敼鍘诲娍 + * + * @param scCastrate 鍘诲娍 + * @return 缁撴灉 + */ + public int updateScCastrate(ScCastrate scCastrate); + + /** + * 鎵归噺鍒犻櫎鍘诲娍 + * + * @param ids 闇瑕佸垹闄ょ殑鍘诲娍涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteScCastrateByIds(Long[] ids); + + /** + * 鍒犻櫎鍘诲娍淇℃伅 + * + * @param id 鍘诲娍涓婚敭 + * @return 缁撴灉 + */ + public int deleteScCastrateById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/service/impl/ScCastrateServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/service/impl/ScCastrateServiceImpl.java new file mode 100644 index 0000000..5279d7d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/service/impl/ScCastrateServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.produce.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.produce.domain.ScCastrate; +import com.zhyc.module.produce.mapper.ScCastrateMapper; +import com.zhyc.module.produce.service.IScCastrateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 鍘诲娍Service涓氬姟灞傚鐞 + * + * @author ruoyi + * @date 2025-07-09 + */ +@Service +public class ScCastrateServiceImpl implements IScCastrateService +{ + @Autowired + private ScCastrateMapper scCastrateMapper; + + /** + * 鏌ヨ鍘诲娍 + * + * @param id 鍘诲娍涓婚敭 + * @return 鍘诲娍 + */ + @Override + public ScCastrate selectScCastrateById(Long id) + { + return scCastrateMapper.selectScCastrateById(id); + } + + /** + * 鏌ヨ鍘诲娍鍒楄〃 + * + * @param scCastrate 鍘诲娍 + * @return 鍘诲娍 + */ + @Override + public List selectScCastrateList(ScCastrate scCastrate) + { + return scCastrateMapper.selectScCastrateList(scCastrate); + } + + /** + * 鏂板鍘诲娍 + * + * @param scCastrate 鍘诲娍 + * @return 缁撴灉 + */ + @Override + public int insertScCastrate(ScCastrate scCastrate) + { + scCastrate.setCreateTime(DateUtils.getNowDate()); + return scCastrateMapper.insertScCastrate(scCastrate); + } + + /** + * 淇敼鍘诲娍 + * + * @param scCastrate 鍘诲娍 + * @return 缁撴灉 + */ + @Override + public int updateScCastrate(ScCastrate scCastrate) + { + return scCastrateMapper.updateScCastrate(scCastrate); + } + + /** + * 鎵归噺鍒犻櫎鍘诲娍 + * + * @param ids 闇瑕佸垹闄ょ殑鍘诲娍涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteScCastrateByIds(Long[] ids) + { + return scCastrateMapper.deleteScCastrateByIds(ids); + } + + /** + * 鍒犻櫎鍘诲娍淇℃伅 + * + * @param id 鍘诲娍涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteScCastrateById(Long id) + { + return scCastrateMapper.deleteScCastrateById(id); + } +} diff --git a/zhyc-module/src/main/resources/mapper/produce/ScCastrateMapper.xml b/zhyc-module/src/main/resources/mapper/produce/ScCastrateMapper.xml new file mode 100644 index 0000000..ff35dfa --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/produce/ScCastrateMapper.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_castrate + + + + + + + + insert into sc_castrate + + sheep_id, + sheepfold, + comment, + technician, + create_by, + create_time, + + + #{sheepId}, + #{sheepfold}, + #{comment}, + #{technician}, + #{createBy}, + #{createTime}, + + + + + update sc_castrate + + sheep_id = #{sheepId}, + sheepfold = #{sheepfold}, + comment = #{comment}, + technician = #{technician}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sc_castrate where id = #{id} + + + + delete from sc_castrate where id in + + #{id} + + + \ No newline at end of file