Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
35个文件已修改
10个文件已添加
15个文件已删除
| | |
| | | userErr:'Please enter your user id', |
| | | pwErr:'Please enter your password', |
| | | loginSuccessful:'User login successful', |
| | | connectErr:'server connection failed', |
| | | loginErr:'The account or password is incorrect', |
| | | connectErr:'Login timed out, please login again', |
| | | user:'User', |
| | | password:'Pass', |
| | | SysName:'North Glass ERP System', |
| | |
| | | titleFirst:"Welcome ", |
| | | titleLast:' to use North Glass ERP system!' |
| | | }, |
| | | error:{ |
| | | Code_401:'The user does not have this permission', |
| | | Code_402:'Login timed out, please login again' |
| | | }, |
| | | basicData:{ |
| | | create:'New Order', |
| | | review:"Review", |
| | |
| | | userErr:'请输入你的账号', |
| | | pwErr:'请输入你的密码', |
| | | loginSuccessful:'登录成功', |
| | | connectErr:'服务器连接失败', |
| | | loginErr:'账号或密码错误', |
| | | connectErr:'登录超时,请重新登录', |
| | | user:'用户', |
| | | password:'密码', |
| | | SysName:'北玻自动化ERP管理系统', |
| | |
| | | titleFirst:"欢迎 ", |
| | | titleLast:' 使用北玻ERP系统!' |
| | | }, |
| | | error:{ |
| | | Code_401:'用户暂无此权限', |
| | | Code_402:'登录超时,请重新登录' |
| | | }, |
| | | basicData:{ |
| | | create:'创建', |
| | | review:"审核", |
| | |
| | | const router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const user = userStore.user.userName |
| | | watch(()=>userStore.responseCode,(newVal) => { |
| | | switch (newVal){ |
| | | case 401:{ |
| | | if(userStore.msg.split('.')[1] === 'search'){ |
| | | router.push({path:'/main/order/notPermission'}); |
| | | }else{ |
| | | ElMessage.warning(t('error.Code_401')) |
| | | } |
| | | userStore.responseCode=null |
| | | break |
| | | } |
| | | case 402:{ |
| | | ElMessage.warning(t('error.Code_402')) |
| | | router.push("/login") |
| | | break |
| | | } |
| | | default:{ |
| | | break |
| | | } |
| | | } |
| | | } |
| | | ) |
| | | |
| | | store.createWebSocket(); |
| | | function quit(){ |
| | | userStore.$patch({ |
| | | user:null |
| | | }) |
| | | router.push("/login") |
| | | request.post('/userInfo/logout').finally(()=>{ |
| | | router.push("/login") |
| | | }) |
| | | |
| | | // |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //提取模块列表 |
| | | let menuList=$ref([]) |
| | | request.get(`/menu/getMenu/${lang}`).then((res) => { |
| | | if(res.code==200){ |
| | | menuList= deepClone(res.data) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }).catch((e)=>{ |
| | | ElMessage.warning(t('main.connectErr')) |
| | | router.push("/login") |
| | | onMounted(()=>{ |
| | | request.get(`/menu/getMenu/${lang}`).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | menuList= deepClone(res.data) |
| | | } |
| | | }) |
| | | |
| | | }) |
| | | |
| | | |
| | | //获取菜单列表 |
| | | let menuItemList=$ref([]) |
| | | request.get(`/menuItem/getMenuItem/${lang}`).then((res) => { |
| | |
| | | component: () => import('../views/sd/order/Order.vue'), |
| | | children:[ |
| | | { |
| | | path: 'notPermission', |
| | | name: 'notPermission', |
| | | component: () => import('../views/sd/order/NotPermission.vue'), |
| | | }, |
| | | { |
| | | path: 'selectOrder', |
| | | name: 'selectOrder', |
| | | component: () => import('../views/sd/order/SelectOrder.vue'), |
| | |
| | | import {createWebSocket, global_callback1} from "@/utils/webSocket"; |
| | | |
| | | export default defineStore("userInfo",{ |
| | | state: () =>{ |
| | | let user=ref({ |
| | | userName:null, |
| | | userId:null |
| | | }) |
| | | return { |
| | | user |
| | | } |
| | | }, |
| | | state: () =>({ |
| | | user:ref({ |
| | | userName:null, |
| | | userId:null |
| | | }), |
| | | responseCode:null, |
| | | msg:null |
| | | }), |
| | | actions:{ |
| | | createWebSocket(){ |
| | | createWebSocket(global_callback1) |
| | | }, |
| | | setResponseCode(cede,msg){ |
| | | this.responseCode=cede |
| | | this.msg = msg |
| | | } |
| | | |
| | | }, |
| | |
| | | request.interceptors.request.use(config => { |
| | | config.headers['Content-Type'] = 'application/json;charset=utf-8'; |
| | | if(userStore.user){ |
| | | config.headers['token'] = userStore.user.token; |
| | | config.headers['satoken'] = userStore.user.token; |
| | | } |
| | | // 设置请求头 |
| | | return config |
| | |
| | | // 可以在接口响应后统一处理结果 |
| | | request.interceptors.response.use( |
| | | response => { |
| | | let res = response.data; |
| | | let res = response.data |
| | | //传递报错信息,把报错信息传递到pinia中 |
| | | userStore.setResponseCode(parseInt(res.code),res.msg) |
| | | if(res.code!=='200'){ |
| | | return Promise.reject(res.code) |
| | | } |
| | | |
| | | // 如果是返回的文件 |
| | | if (response.config.responseType === 'blob') { |
| | | return res |
| | |
| | | if (valid) { |
| | | loginLoadings.value=true |
| | | userForm.pass = btoa(userForm.pass) |
| | | request.post('/user/login', |
| | | request.post('/userInfo/login', |
| | | userForm).then((res) => { |
| | | if(res['code']==200){ |
| | | if(res['code']==200 && res['data']){ |
| | | store.$patch({user:res.data}) |
| | | |
| | | router.push('/main') |
| | | ElMessage.success(t('login.loginSuccessful')) |
| | | } else { |
| | | ElMessage.error(res['msg']) |
| | | ElMessage.error(t('login.loginErr')) |
| | | loginLoadings.value=false |
| | | return false |
| | | } |
| | |
| | | const register = reactive({ |
| | | userName: '', |
| | | // loginName: '', |
| | | passWord: '', |
| | | password: '', |
| | | confirmPassword:'' |
| | | }) |
| | | |
| | |
| | | const checkConfirmPassword = (rule: any, value: any, callback: any) => { |
| | | if (value.trim() === '') { |
| | | callback(new Error('确认密码不能为空')) |
| | | }else if(value !== register.passWord){ |
| | | }else if(value !== register.password){ |
| | | callback(new Error('两次密码不相同')) |
| | | }else if(value.length>16 || value.length<6){ |
| | | callback(new Error('密码长度不能低于6或超过16')) |
| | |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const rules = reactive<FormRules<typeof register>>({ |
| | | userName: [{ validator: checkName, trigger: 'blur' }], |
| | | passWord:[{ validator: checkPassword, trigger: 'blur' }], |
| | | password:[{ validator: checkPassword, trigger: 'blur' }], |
| | | confirmPassword:[{ validator: checkConfirmPassword, trigger: 'blur' }], |
| | | // loginName: [{ validator: validateString, trigger: 'blur' }] |
| | | }) |
| | |
| | | formEl.validate((valid) => { |
| | | if (valid) { |
| | | loginLoadings.value=true |
| | | register.passWord = btoa(register.passWord) |
| | | register.password = btoa(register.password) |
| | | request.post('/user/register', |
| | | register).then((res) => { |
| | | if(res['code']==200){ |
| | |
| | | <!-- <el-form-item label="登陆名:" prop="loginName">--> |
| | | <!-- <el-input v-model="register.loginName" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="密码:" prop="passWord"> |
| | | <el-input type="password" v-model="register.passWord" /> |
| | | <el-form-item label="密码:" prop="password"> |
| | | <el-input type="password" v-model="register.password" /> |
| | | </el-form-item> |
| | | <el-form-item label="确认密码:" prop="confirmPassword"> |
| | | <el-input type="password" v-model="register.confirmPassword" /> |
| | |
| | | break |
| | | } |
| | | case 'update': { |
| | | getQuantity() |
| | | const errMap = await $grid.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(`校验不通过!`) |
| | |
| | | request.post(`/order/cancelOrder/${titleUploadData.value.orderId}`).then((res) =>{ |
| | | if (res.code== 200){ |
| | | ElMessage.success(t('order.msg.updateOrderState')) |
| | | router.push({path:'/main/order/createOrder',query:{orderId:titleUploadData.value.orderId,random:Math.random()}}) |
| | | router.push({ |
| | | path:'/main/order/createOrder', |
| | | query:{ |
| | | orderId:titleUploadData.value.orderId, |
| | | random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | | } |
New file |
| | |
| | | <script setup> |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | 无此页面权限 |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | <el-row> |
| | | <el-col :span="4">商标位置:</el-col> |
| | | <el-col :span="25"> |
| | | <el-radio v-model="trademarkAttr.location" v-for="item in trademarkLocation" :label="item" /> |
| | | <el-checkbox v-model="trademarkAttr.location" v-for="item in trademarkLocation" :label="item" /> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | |
| | | <artifactId>hibernate-core</artifactId> |
| | | <version>4.3.5.Final</version> |
| | | </dependency> |
| | | |
| | | <!--后端导出--> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.2.1</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>cn.dev33</groupId> |
| | | <artifactId>sa-token-spring-boot-starter</artifactId> |
| | | <version>1.37.0</version> |
| | | </dependency> |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | public interface Constants { |
| | | String Code_500="500";//系统错误 |
| | | String Code_401="401";//权限不足 |
| | | String Code_402="402";//还未登陆 |
| | | String Code_400="400";// |
| | | String Code_200="200";//成功 |
| | | String Code_600="600";//其他问题 |
New file |
| | |
| | | package com.example.erp.config; |
| | | |
| | | import cn.dev33.satoken.interceptor.SaInterceptor; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | @Configuration |
| | | public class SaTokenConfigure implements WebMvcConfigurer { |
| | | // 注册 Sa-Token 拦截器,打开注解式鉴权功能 |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | // 注册 Sa-Token 拦截器,打开注解式鉴权功能 |
| | | registry.addInterceptor(new SaInterceptor()).addPathPatterns("/**"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.erp.config; |
| | | |
| | | import cn.dev33.satoken.stp.StpInterface; |
| | | import com.example.erp.service.userInfo.PermissionRoleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 自定义权限认证接口扩展,Sa-Token 将从此实现类获取每个账号拥有的权限码 |
| | | * |
| | | * @author kong |
| | | * @since 2022-10-13 |
| | | */ |
| | | @Component // 打开此注解,保证此类被springboot扫描,即可完成sa-token的自定义权限验证扩展 |
| | | public class StpInterfaceImpl implements StpInterface { |
| | | private final PermissionRoleService permissionRoleService; |
| | | |
| | | public StpInterfaceImpl(PermissionRoleService permissionRoleService) { |
| | | this.permissionRoleService = permissionRoleService; |
| | | } |
| | | |
| | | /** |
| | | * 返回一个账号所拥有的权限码集合 |
| | | */ |
| | | @Override |
| | | public List<String> getPermissionList(Object loginId, String loginType) { |
| | | // 本list仅做模拟,实际项目中要根据具体业务逻辑来查询权限 |
| | | /*List<String> list = new ArrayList<>(); |
| | | list.add("101"); |
| | | list.add("user.add"); |
| | | list.add("user.update"); |
| | | list.add("user.get"); |
| | | // list.add("user.delete"); |
| | | list.add("art.*");*/ |
| | | |
| | | return permissionRoleService.getUserPermission(Integer.parseInt((String) loginId)); |
| | | } |
| | | /** |
| | | * 返回一个账号所拥有的角色标识集合 |
| | | */ |
| | | @Override |
| | | public List<String> getRoleList(Object loginId, String loginType) { |
| | | return permissionRoleService.getUserRole(Integer.parseInt((String) loginId)); |
| | | } |
| | | } |
| | |
| | | import lombok.Data; |
| | | @Data //用于接受前端登录额user信息 |
| | | public class UserDTO { |
| | | private Integer id; |
| | | private String userId; |
| | | private String pass; |
| | | private String token; |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.Order; |
| | |
| | | } |
| | | } |
| | | @ApiOperation("订单分页筛选查询") |
| | | @SaCheckPermission("selectOrder.search") |
| | | @PostMapping("/getOrderList/{pageNum}/{pageSize}/{orderType}/{selectDate}") |
| | | public Result getOrderList(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable Integer orderType, @PathVariable List<String> selectDate, @RequestBody Order order) { |
| | | return Result.seccess(orderService.getOrderList(pageNum, pageSize, selectDate, order,orderType)); |
| | |
| | | package com.example.erp.controller.userInfo; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckLogin; |
| | | import com.example.erp.common.CacheUtil; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.service.userInfo.SysMenuService; |
| | |
| | | @RequestMapping("/menu") |
| | | |
| | | public class SysMenuController { |
| | | @Autowired |
| | | private CacheUtil cacheUtil; |
| | | @Autowired |
| | | private SysMenuService sysMenuService; |
| | | private final CacheUtil cacheUtil; |
| | | private final SysMenuService sysMenuService; |
| | | |
| | | public SysMenuController(CacheUtil cacheUtil, SysMenuService sysMenuService) { |
| | | this.cacheUtil = cacheUtil; |
| | | this.sysMenuService = sysMenuService; |
| | | } |
| | | |
| | | @SaCheckLogin |
| | | @GetMapping("/getMenu/{lang}") |
| | | public Result getMenu(@PathVariable String lang){ |
| | | MyChannelHandlerPool myChannelHandlerPool = new MyChannelHandlerPool(); |
New file |
| | |
| | | package com.example.erp.controller.userInfo; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckLogin; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import cn.dev33.satoken.stp.StpUtil; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.controller.dto.UserDTO; |
| | | import com.example.erp.service.userInfo.UserService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @RequestMapping("/userInfo") |
| | | public class UserInfoController { |
| | | private final UserService userService; |
| | | |
| | | |
| | | public UserInfoController(UserService userService) { |
| | | this.userService = userService; |
| | | } |
| | | |
| | | @PostMapping("/login") |
| | | public Result login(@RequestBody UserDTO userDTO) { |
| | | return Result.seccess(userService.doLogin(userDTO)); |
| | | } |
| | | |
| | | @PostMapping("/logout") |
| | | public Result logout() { |
| | | return Result.seccess(userService.logout()); |
| | | } |
| | | |
| | | @PostMapping("/isLogin") |
| | | public Result isLogin() { |
| | | return Result.seccess(userService.isLogin()); } |
| | | |
| | | @SaCheckLogin |
| | | @PostMapping("/userAdd") |
| | | public Result userAdd() { |
| | | return Result.seccess(StpUtil.getTokenInfo()); |
| | | } |
| | | |
| | | @PostMapping("/userDelete") |
| | | @SaCheckPermission("user.delete") |
| | | public Result userDelete() { |
| | | return Result.seccess(123123); |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.erp.entity.userInfo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PermissionBasic { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private String page; |
| | | private String permission; |
| | | private String state; |
| | | } |
New file |
| | |
| | | package com.example.erp.entity.userInfo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PermissionRole { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private Integer roleId; |
| | | private Integer permissionId; |
| | | |
| | | } |
New file |
| | |
| | | package com.example.erp.entity.userInfo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class Role { |
| | | @TableId(type = IdType.AUTO) |
| | | private String id; |
| | | private String role; |
| | | } |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private String loginName; |
| | | private String passWord; |
| | | private String password; |
| | | private String userName; |
| | | private String address; |
| | | private String phone; |
| | |
| | | package com.example.erp.exception; |
| | | |
| | | import cn.dev33.satoken.exception.NotLoginException; |
| | | import cn.dev33.satoken.exception.NotPermissionException; |
| | | import cn.dev33.satoken.util.SaResult; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import org.springframework.web.bind.annotation.ControllerAdvice; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | @ControllerAdvice |
| | | public class GlobalExceptionHandle { |
| | |
| | | public Result handle(ServiceException se){ |
| | | return Result.error(se.getCode(),se.getMessage()); |
| | | } |
| | | |
| | | @ExceptionHandler(NotPermissionException.class) |
| | | @ResponseBody |
| | | public Result handlerException(NotPermissionException e) { |
| | | return Result.error(Constants.Code_401,e.getPermission()); |
| | | } |
| | | |
| | | // 拦截:未登录异常 |
| | | @ExceptionHandler(NotLoginException.class) |
| | | @ResponseBody |
| | | public Result handlerException(NotLoginException e) { |
| | | // 返回给前端 |
| | | return Result.error(Constants.Code_402,"Please login user"); |
| | | } |
| | | } |
| | |
| | | List<Map<String, Object>> getDetailList(String processId, Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> getProcessList(String processId, Integer technologyNumber); |
| | | |
| | | Boolean updateInventory(String processId, String orderNumber, String technologyNumber, int completedQuantity); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.ReportingWorkDetail; |
| | | import com.example.erp.entity.pp.Rework; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface ReportingWorkDetailMapper extends BaseMapper<ReportingWorkDetail> { |
| | |
| | | @Param("sDate") String startTime,@Param("eDate") String endTime,ReportingWorkDetail reportingWorkDetail); |
| | | |
| | | |
| | | Integer selectInventory(@Param("processId") String processId, @Param("orderNumber") Integer orderNumber, @Param("technologyNumber") Integer technologyNumber); |
| | | } |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.ReportingWorkDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<Map<String,Integer>> getGlassLRow(String orderId); |
| | | |
| | | List<Map<String, String>> filterLastProcess(String orderId, String orderNumber, String technologyNumber,String id); |
| | | |
| | | void insertByReportingWorkDetail(ReportingWorkDetail reportingWorkDetail, String processId, String thisProcess); |
| | | } |
New file |
| | |
| | | package com.example.erp.mapper.userInfo; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.userInfo.PermissionRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface PermissionRoleMapper extends BaseMapper<PermissionRole> { |
| | | List<String> getUserPermission(Integer loginId); |
| | | } |
| | |
| | | package com.example.erp.mapper.userInfo; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.controller.dto.UserDTO; |
| | | import com.example.erp.entity.userInfo.User; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | |
| | | @Mapper |
| | | |
| | | public interface UserMapper { |
| | | public interface UserMapper extends BaseMapper<User> { |
| | | List<User> findAll(); |
| | | |
| | | User findOne(Integer id); |
| | |
| | | |
| | | |
| | | Boolean register(User user); |
| | | |
| | | List<String> getUserRole(Integer id); |
| | | } |
| | |
| | | patchMapper.updateReplenish(patchLog,userName); |
| | | ReportingWork reportingWork = reportingWorkMapper |
| | | .selectOne(new QueryWrapper<ReportingWork>().eq("reporting_work_id",patchLog.getReportingWorkId())); |
| | | System.out.println(patchLog); |
| | | //修改小片流程卡数量 |
| | | patchMapper.updateOrderProcessDetail(patchLog,reportingWork); |
| | | } |
| | |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | | ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class); |
| | | List<ReportingWorkDetail> reportingWorkDetails = JSONArray.parseArray(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class); |
| | | |
| | | //删除刺破明细表刺破数据 |
| | | damageDetailsMapper.delete( |
| | | new LambdaQueryWrapper<DamageDetails>() |
| | |
| | | //更细报工主表 |
| | | reportingWorkMapper.updateById(reportingWork); |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | reportingWorkDetail.setReportingWorkId(reportingWork.getReportingWorkId()); |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | //每一条报工数据循环插入次破明细表 |
| | | if (damageDetails != null && !damageDetails.isEmpty()) { |
| | |
| | | } |
| | | //插入报工数据 |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | orderProcessDetailMapper.insertByReportingWorkDetail(reportingWorkDetail,reportingWork.getProcessId(),reportingWork.getThisProcess()); |
| | | //修改包装时修改库存数量 |
| | | if (reportingWork.getNextProcess()==null || reportingWork.getNextProcess().isEmpty()){ |
| | | //获取该报工修改后的可入库数量 |
| | | Integer inventory = reportingWorkDetailMapper.selectInventory(reportingWork.getProcessId(),Integer.parseInt(reportingWorkDetail.getOrderNumber()),Integer.parseInt(reportingWorkDetail.getTechnologyNumber())); |
| | | //修改流程卡表库存数量 |
| | | flowCardMapper.updateInventory(reportingWork.getProcessId(),reportingWorkDetail.getOrderNumber(),reportingWorkDetail.getTechnologyNumber(),inventory); |
| | | } |
| | | }); |
| | | //获取质检时间 |
| | | if (Objects.equals(reviewState, "review")) { |
| | |
| | | } |
| | | |
| | | //修改小片流程表数量为报工明细表数量 |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add"); |
| | | //orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add"); |
| | | return true; |
| | | } |
| | | |
New file |
| | |
| | | package com.example.erp.service.userInfo; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.mapper.userInfo.PermissionRoleMapper; |
| | | import com.example.erp.mapper.userInfo.UserMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @DS("user_info") |
| | | @Service |
| | | public class PermissionRoleService { |
| | | private final PermissionRoleMapper permissionRoleMapper; |
| | | private final UserMapper userMapper; |
| | | |
| | | public PermissionRoleService(PermissionRoleMapper permissionRoleMapper, UserMapper userMapper) { |
| | | this.permissionRoleMapper = permissionRoleMapper; |
| | | this.userMapper = userMapper; |
| | | } |
| | | |
| | | public List<String> getUserPermission(Integer loginId) { |
| | | // 调用数据库查询用户权限 |
| | | return permissionRoleMapper.getUserPermission(loginId); |
| | | } |
| | | |
| | | public List<String> getUserRole(Integer id) { |
| | | return userMapper.getUserRole(id); |
| | | } |
| | | } |
| | |
| | | package com.example.erp.service.userInfo; |
| | | |
| | | import cn.dev33.satoken.stp.StpUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.common.CacheUtil; |
| | | import com.example.erp.common.Result; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.controller.dto.UserDTO; |
| | | import com.example.erp.entity.userInfo.User; |
| | | import com.example.erp.mapper.userInfo.UserMapper; |
| | | import com.example.erp.controller.dto.UserDTO; |
| | | import com.example.erp.tools.TokenTools; |
| | | import org.apache.ibatis.jdbc.Null; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("user_info") |
| | | public class UserService { |
| | | |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | private final UserMapper userMapper; |
| | | |
| | | public UserService(UserMapper userMapper) { |
| | | this.userMapper = userMapper; |
| | | } |
| | | |
| | | |
| | | @Cacheable(value="users", key="#userDTO.getUserId()") |
| | |
| | | } |
| | | return returnUser; |
| | | } |
| | | |
| | | /*----------------新版本登陆*/ |
| | | public UserDTO doLogin(UserDTO userDTO) { |
| | | User user = userMapper.selectOne(new QueryWrapper<User>(). |
| | | eq("login_name", userDTO.getUserId()).eq("password", userDTO.getPass())); |
| | | if(user!=null){ |
| | | StpUtil.login(user.getId()); |
| | | userDTO.setPass(null); |
| | | userDTO.setId(user.getId()); |
| | | userDTO.setUserName(user.getUserName()); |
| | | userDTO.setToken(StpUtil.getTokenValue()); |
| | | return userDTO; |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public Boolean isLogin() { |
| | | // 返回当前用户是否登录 |
| | | return StpUtil.isLogin(); |
| | | } |
| | | |
| | | public Boolean logout() { |
| | | StpUtil.logout(); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | |
| | | and technology_number = #{technologyNumber} |
| | | group by process |
| | | </select> |
| | | |
| | | <update id="updateInventory"> |
| | | update flow_card set inventory_quantity=#{completedQuantity} |
| | | where process_id = #{processId} and order_number = #{orderNumber} and technology_number = #{technologyNumber} |
| | | </update> |
| | | </mapper> |
| | |
| | | and b.process_id = a.process_id |
| | | left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | group by order_sort,technology_number) as c |
| | | on |
| | | c.process_id = a.process_id |
| | | and c.order_sort = a.order_number |
| | |
| | | and g.technology_number = a.technology_number |
| | | </if> |
| | | where b.reporting_work_id = #{reportingWorkId} |
| | | GROUP BY c.order_number |
| | | GROUP BY c.order_number,c.technology_number |
| | | </select> |
| | | <select id="selectReportingWorkMp" resultMap="reportingWorkMap"> |
| | | select rw.reporting_work_id, |
| | |
| | | <result column="child_width" property="childWidth"/> |
| | | |
| | | </association> |
| | | <association property="OrderProcessDetail" javaType="com.example.erp.entity.sd.OrderProcessDetail"> |
| | | <result column="reporting_work_num" property="reportingWorkNum"/> |
| | | </association> |
| | | |
| | | |
| | | </resultMap> |
| | |
| | | where reporting_work_id = #{reportingWorkId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectInventory"> |
| | | select reporting_work_num |
| | | FROM sd.order_process_detail as opd |
| | | where opd.process_id = #{processId} |
| | | and opd.order_number = #{orderNumber} |
| | | and opd.technology_number = #{technologyNumber} |
| | | and opd.process = '包装' |
| | | </select> |
| | | <!--<where> |
| | | |
| | | create_time <![CDATA[>=]]> #{startTime} and create_time <![CDATA[<=]]> #{endTime}} |
| | |
| | | `b`.`available` = 1) |
| | | </select>--> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | group by a.order_number |
| | | |
| | | </select> |
| | | <update id="insertByReportingWorkDetail"> |
| | | update sd.order_process_detail as a |
| | | set |
| | | a.reporting_work_num_count= |
| | | a.reporting_work_num_count+#{reportingWorkDetail.completedQuantity}, |
| | | a.reporting_work_num =a.reporting_work_num +#{reportingWorkDetail.completedQuantity}, |
| | | a.broken_num =a.broken_num +#{reportingWorkDetail.breakageQuantity} |
| | | |
| | | where |
| | | a.process_id = #{processId} |
| | | and a.order_number= #{reportingWorkDetail.orderNumber} |
| | | and a.technology_number= #{reportingWorkDetail.technologyNumber} |
| | | and a.process=#{thisProcess} |
| | | |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.userInfo.PermissionRoleMapper"> |
| | | <select id="getUserPermission"> |
| | | select |
| | | concat( |
| | | if(d.page=null || d.page='','',concat(d.page, '.')), |
| | | d.permission |
| | | ) as 'permission' |
| | | from user as a |
| | | left join user_role as e |
| | | on e.user_id = a.id |
| | | left join role as b |
| | | on e.role_id = b.id |
| | | left join permission_role as c |
| | | on b.id = c.role_id |
| | | left join permission_basic d |
| | | on d.id = c.permission_id |
| | | where a.id = #{loginId} |
| | | and d.state = 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | insert erp_user_info.user |
| | | (password,user_name) |
| | | values ( |
| | | #{passWord} ,#{userName} |
| | | #{password} ,#{userName} |
| | | ) |
| | | </insert> |
| | | |
| | | <select id="getUserRole"> |
| | | SELECT |
| | | c.role |
| | | from |
| | | user as a |
| | | left join user_role as b |
| | | on a.id = b.user_id |
| | | left join role as c |
| | | on b.role_id = c.id |
| | | where a.id = #{loginId} |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | and technology_number = #{technologyNumber} |
| | | group by process |
| | | </select> |
| | | |
| | | <update id="updateInventory"> |
| | | update flow_card set inventory_quantity=#{completedQuantity} |
| | | where process_id = #{processId} and order_number = #{orderNumber} and technology_number = #{technologyNumber} |
| | | </update> |
| | | </mapper> |
| | |
| | | and b.process_id = a.process_id |
| | | left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | group by order_sort,technology_number) as c |
| | | on |
| | | c.process_id = a.process_id |
| | | and c.order_sort = a.order_number |
| | |
| | | and g.technology_number = a.technology_number |
| | | </if> |
| | | where b.reporting_work_id = #{reportingWorkId} |
| | | GROUP BY c.order_number |
| | | GROUP BY c.order_number,c.technology_number |
| | | </select> |
| | | <select id="selectReportingWorkMp" resultMap="reportingWorkMap"> |
| | | select rw.reporting_work_id, |
| | |
| | | <result column="child_width" property="childWidth"/> |
| | | |
| | | </association> |
| | | <association property="OrderProcessDetail" javaType="com.example.erp.entity.sd.OrderProcessDetail"> |
| | | <result column="reporting_work_num" property="reportingWorkNum"/> |
| | | </association> |
| | | |
| | | |
| | | </resultMap> |
| | |
| | | where reporting_work_id = #{reportingWorkId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectInventory"> |
| | | select reporting_work_num |
| | | FROM sd.order_process_detail as opd |
| | | where opd.process_id = #{processId} |
| | | and opd.order_number = #{orderNumber} |
| | | and opd.technology_number = #{technologyNumber} |
| | | and opd.process = '包装' |
| | | </select> |
| | | <!--<where> |
| | | |
| | | create_time <![CDATA[>=]]> #{startTime} and create_time <![CDATA[<=]]> #{endTime}} |
| | |
| | | `b`.`available` = 1) |
| | | </select>--> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | group by a.order_number |
| | | |
| | | </select> |
| | | <update id="insertByReportingWorkDetail"> |
| | | update sd.order_process_detail as a |
| | | set |
| | | a.reporting_work_num_count= |
| | | a.reporting_work_num_count+#{reportingWorkDetail.completedQuantity}, |
| | | a.reporting_work_num =a.reporting_work_num +#{reportingWorkDetail.completedQuantity}, |
| | | a.broken_num =a.broken_num +#{reportingWorkDetail.breakageQuantity} |
| | | |
| | | where |
| | | a.process_id = #{processId} |
| | | and a.order_number= #{reportingWorkDetail.orderNumber} |
| | | and a.technology_number= #{reportingWorkDetail.technologyNumber} |
| | | and a.process=#{thisProcess} |
| | | |
| | | </update> |
| | | </mapper> |
| | |
| | | insert erp_user_info.user |
| | | (password,user_name) |
| | | values ( |
| | | #{passWord} ,#{userName} |
| | | #{password} ,#{userName} |
| | | ) |
| | | </insert> |
| | | |
| | | <select id="getUserRole"> |
| | | SELECT |
| | | c.role |
| | | from |
| | | user as a |
| | | left join user_role as b |
| | | on a.id = b.user_id |
| | | left join role as c |
| | | on b.role_id = c.id |
| | | where a.id = #{loginId} |
| | | |
| | | </select> |
| | | </mapper> |