current position:Home>Java project: agricultural material management system (java + springboot + easyUI + HTML + Maven + MySQL)

Java project: agricultural material management system (java + springboot + easyUI + HTML + Maven + MySQL)

2022-04-29 16:40:37OldWinePot

The source code for : Blog's front page " resources " Download !

Project introduction

Agricultural material management system , Administrators can configure roles , Assign user roles ;
The main functions include : Sign in 、 register 、 Change Password 、 Retail delivery 、 Retail returns 、 Purchase order management 、 Purchase receipt management 、 Purchase return management 、 Sales management 、 Financial management 、 Report management 、 material management 、 Basic data management .

Environmental needs

1. Running environment : It is best to java jdk 1.8, We run on this platform . Other versions can, in theory .
2.IDE Environmental Science :IDEA,Eclipse,Myeclipse Fine . recommend IDEA;
3.tomcat Environmental Science :Tomcat 7.x,8.x,9.x All versions are available
4. Hardware environment :windows 7/8/10 1G Above memory ; perhaps Mac OS;
5. database :MySql 5.7 edition ;

6. whether Maven project : yes ;

Technology stack

1. Back end :springboot MyBatis

2. front end :HTML+css+javascript+jQuery+easyui

Instructions

1. Use Navicat Or other tools , stay mysql Create a database with the corresponding name in , And import the sql file ;
2. Use IDEA/Eclipse/MyEclipse Import the project ,Eclipse/MyEclipse Import time , if maven Item, please select maven;
if maven project , After importing successfully, please execute maven clean;maven install command , To configure tomcat, And then run ;
3. In the project application.properties Change the database configuration in the configuration file to your own configuration ;
4. After successful operation , visit http://localhost:8080/ Go to the login page
Administrator user name :admin password :123456

 

 

 

 

Organization controller :

/**
 *  Organization controller 
 */

@Controller
@RequestMapping("/organization")
public class OrgController {
    @Autowired
    private OrganizationService organizationService;

    /**
     *  Dynamically query and organize information according to conditions , Load data into table 
     */
    @PostMapping("/list")
    public String listOrganizationByLevel(Organization example, ModelMap map){
        List<Organization> list = organizationService.listOrganizationByExample(example);
        int sublevel = example.getOrgLevel();
        map.put("dtoList",list);
        String pageName = null;
        switch (sublevel) {  // Determine the return page target according to the parameters 
            case  1: pageName= "friDepartments" ;break;
            case  2: pageName= "secDepartments" ;break;
            case  3: pageName= "macAddress" ;break;
        }
        return  pageName+"::table-refresh";
    }

    /**
     *  Query child organizations dynamically according to conditions 
     */
    @PostMapping("/sub/list")
    @ResponseBody
    public List listOrganization(Organization example){
        List<Organization> list = organizationService.listOrganizationByExample(example);
        return  list;
    }

    /**
     *  According to the primary and secondary departments id Query physical location 
     */
    @PostMapping("/macAddress/list")
    public String listMacaddress(String fristId,String secondId,ModelMap map){
        List<Organization> list = organizationService.listMacaddressByRootID(fristId,secondId);
        map.put("dtoList",list);
        return  "macAddress::table-refresh";
    }



    /**
     *  Add organization 
     * @param organization
     * @return
     */
    @PostMapping
    @ResponseBody
    public int addOrganization(Organization organization){
        return organizationService.insertOrganization(organization);
    }

    /**
     *  Delete organization 
     * @param orgId
     * @return
     */
    @DeleteMapping("/{orgId}")
    @ResponseBody
    public int delteOrganizationByid(@PathVariable("orgId") String orgId){
        return organizationService.deleteOrganizationById(orgId);
    }

    /**
     *  Modify organization name 
     * @param organization
     * @return
     */
    @PutMapping
    @ResponseBody
    public int updateDeviceType(Organization organization){
        return organizationService.updateOrganizationName(organization);
    }

    /**
     *  Get the organization tree 
     * @return
     */
    @GetMapping("/tree")
    @ResponseBody
    public OrganizationDTO getOrganizationTree(){
        return organizationService.getOrgTree();
    }

}

User access controller :

@Controller
@RequestMapping("/account")
public class AccountController {
    // Automatically inject service classes 
    @Autowired
    private AccountService accountService;

    /**
     *  Administrator account information 
     * @return
     */
    @GetMapping("/admins")
    public String listAdmins(ModelMap map){
        List<AccountDTO> adminList = accountService.listAccountByLevel(2);
        List<AccountDTO> superAdminList = accountService.listAccountByLevel(1);
        adminList.addAll(superAdminList);
        map.put("adminsList", adminList);
        return "system::table-refresh";
    }

    /**
     *  Get all account information 
     * @param map
     * @return
     */
    @GetMapping("/list")
    public String listAccounts(ModelMap map){
       List<AccountDTO> accountList = accountService.listAccount();
        map.put("accountDTOList", accountList);
        return "account::table-refresh";
    }

    /**
     *  Search for users by user name 
     * @param map
     * @param userName
     * @return
     */
    @GetMapping("/list/{userName}")
    public String listAccountsByUserName(ModelMap map,@PathVariable("userName")String userName){
       List<AccountDTO> accountList = accountService.listAccountByName(userName);
        map.put("accountDTOList", accountList);
        return "account::table-refresh";
    }
    /**
     *  Add administrator page 
     * @param map
     * @return
     */
    @GetMapping("/users")
    public String listUsers(ModelMap map){
        List<AccountDTO> accountList = accountService.listAccountByLevel(3);
        map.put("usersDTOList", accountList);
        return "system::list-refresh";
    }

    /**
     *  Get the user information of the device 
     * @param map
     * @param devId
     * @return
     */
    @GetMapping("/ownerList")
    public String getOwnerList(ModelMap map, String devId){
        Map resMap  = accountService.listOwenrByDevId(devId);
        map.put("ownerMap", resMap);
        return "allotDevice::list-refresh";
    }

    /**
     *  Add account 
     * @param account
     * @return
     */
    @PostMapping
    @ResponseBody
    public int addAccount(Account account){
        return accountService.addAccount(account);
    }

    /**
     *  according to uuid Delete account 
     * @param uuid
     * @return
     */
    @DeleteMapping("/{uuid}")
    @ResponseBody
    public int deleteAccount(@PathVariable("uuid")String uuid){
        return accountService.deleteAccountById(uuid);
    }

    /**
     *  Change account password 
     * @param uuid
     * @param password
     * @return
     */
    @PutMapping("/password")
    @ResponseBody
    public int updatePassword(String uuid, String password){
        return accountService.updatePasswordByid(uuid,password);
    }

    /**
     *  Modify account status 
     * @param uuid
     * @param status
     * @return
     */
    @PutMapping("/status")
    @ResponseBody
    public int updateStatus(String uuid,int status){
        return accountService.updateStatusByid(uuid,status);
    }

    /**
     *  Change Administrator 
     * @return
     */
    @PutMapping("/admins")
    @ResponseBody
    public int updateDevOwner(HttpServletRequest request){
        String[] groups = request.getParameter("groups").split(",");
        int level = Integer.parseInt(request.getParameter("level"));
        return  accountService.updateAccountLevel(level,groups);
    };

}

Material and equipment management control layer :

@Controller
@RequestMapping("/baseInfos")
public class BaseInfoController {

    @Autowired
    private BaseInfoService baseInfoService;
    @Autowired
    private LogService logService;

    /**
     *  Get all device type information 
     * @param map
     * @return
     */
    @RequestMapping("/type/list")
    public String listDeviceType(ModelMap map){
        List<DeviceType> typeList = baseInfoService.listDeviceType();
        map.put("typeList",typeList);
     return "deviceTypes::table-refresh";
    }

    /**
     *  Add device type 
     * @param deviceType
     * @return
     */
    @PostMapping("/type")
    @ResponseBody
    public int addtDeviceType(DeviceType deviceType){
        return baseInfoService.addtDeviceType(deviceType);
    }

    /**
     *  Delete device type 
     * @param typeId
     * @return
     */
    @DeleteMapping("/type/{typeId}")
    @ResponseBody
    public int delteDeviceTypByid(@PathVariable("typeId") String typeId){
        return baseInfoService.deleteDeviceTypeById(typeId);
    }

    /**
     *  Modify device type 
     * @param deviceType
     * @return
     */
    @PutMapping("/type")
    @ResponseBody
    public int updateDeviceType(DeviceType deviceType){
        return baseInfoService.updateDeviceType(deviceType);
    }

    /**
     *  Get all equipment brand information 
     * @param map
     * @return
     */
    @RequestMapping("/brand/list")
    public String listDeviceBrand(ModelMap map){
        List<DeviceBrand> brandList = baseInfoService.listDeviceBrand();
        map.put("brandList",brandList);
        return "deviceBrands::table-refresh";
    }

    /**
     *  Add equipment brand 
     * @param deviceBrand
     * @return
     */
    @PostMapping("/brand")
    @ResponseBody
    public int addtDeviceBrand(DeviceBrand deviceBrand){
        return baseInfoService.addtDeviceBrand(deviceBrand);
    }

    /**
     *  Delete equipment brand 
     * @param brandId
     * @return
     */
    @DeleteMapping("/brand/{brandId}")
    @ResponseBody
    public int delteDeviceBrandByid(@PathVariable("brandId") String brandId){
        return baseInfoService.deleteDeviceBrandById(brandId);
    }

    /**
     *  Brand revision 
     * @param deviceBrand
     * @return
     */
    @PutMapping("/brand")
    @ResponseBody
    public int updateDeviceBrand(DeviceBrand deviceBrand){
        return baseInfoService.updateDeviceBrand(deviceBrand);
    }


    /**
     *  Get system log 
     * @param map
     * @return
     */
    @RequestMapping("/log")
    public String listLog(ModelMap map, HttpServletRequest request){
        String startTime = request.getParameter("startTime");
        String endTime = request.getParameter("endTime");
        List<SystemLog> logs = logService.listLogsByDate(startTime,endTime);
        map.put("logList",logs);
        return "system::logList-refresh";
    }


}

The source code for : Blog's front page " resources " Download !

copyright notice
author[OldWinePot],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204291448261639.html

Random recommended