| | |
| | | } |
| | | }, |
| | | { |
| | | path: '/change-password', |
| | | name: 'ChangePassword', |
| | | component: () => import('@/views/ChangePassword.vue'), |
| | | meta:{ |
| | | anonymous:true |
| | | } |
| | | }, |
| | | { |
| | | path: '/bigdata', |
| | | name: 'bigdata', |
| | | component: () => import('@/views/charts/bigdata.vue'), |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="login-container"> |
| | | <div class="project-name">WMS</div> |
| | | <div class="login-form"> |
| | | <div class="form-user" @keypress="changePwdPress"> |
| | | <div class="login-text"> |
| | | <div>ä¿®æ¹å¯ç </div> |
| | | </div> |
| | | <div class="login-text-small">CHANGE PASSWORD</div> |
| | | |
| | | <!-- æ°å¢ï¼ç¨æ·åè¾å
¥æ¡ --> |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-user"></div> |
| | | <input |
| | | type="text" |
| | | v-focus |
| | | v-model="pwdForm.userName" |
| | | placeholder="请è¾å
¥ç¨æ·å" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- æ§å¯ç --> |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-lock"></div> |
| | | <input |
| | | type="password" |
| | | v-model="pwdForm.oldPwd" |
| | | placeholder="请è¾å
¥æ§å¯ç " |
| | | /> |
| | | </div> |
| | | |
| | | <!-- æ°å¯ç --> |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-key"></div> |
| | | <input |
| | | type="password" |
| | | v-model="pwdForm.newPwd" |
| | | placeholder="请è¾å
¥æ°å¯ç " |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 确认æ°å¯ç --> |
| | | <div class="item"> |
| | | <div class="input-icon el-icon-key"></div> |
| | | <input |
| | | type="password" |
| | | v-model="pwdForm.confirmPassword" |
| | | placeholder="请确认æ°å¯ç " |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æäº¤æé® --> |
| | | <div class="loging-btn"> |
| | | <el-button |
| | | size="large" |
| | | :loading="loading" |
| | | color="#3a6cd1" |
| | | :dark="true" |
| | | @click="changePassword" |
| | | long |
| | | > |
| | | <span v-if="!loading">确认修æ¹</span> |
| | | <span v-else>æ£å¨ä¿®æ¹...</span> |
| | | </el-button> |
| | | </div> |
| | | |
| | | <!-- è¿åæé® --> |
| | | <div class="back-login-btn"> |
| | | <el-button |
| | | size="large" |
| | | type="text" |
| | | @click="goBack" |
| | | > |
| | | è¿å |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <img class="login-bg" src="/static/login_bg.png" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | defineComponent, |
| | | ref, |
| | | reactive, |
| | | getCurrentInstance, |
| | | } from "vue"; |
| | | import { useRouter, useRoute } from "vue-router"; |
| | | import store from "../store/index"; |
| | | import http from "@/../src/api/http.js"; |
| | | |
| | | export default defineComponent({ |
| | | setup(props, context) { |
| | | const loading = ref(false); |
| | | const router = useRouter(); |
| | | |
| | | // å¯ç 表åï¼ä¿çåæé»è®¤å¼ï¼æ°å¢ç¨æ·åååç»å®ï¼ |
| | | const pwdForm = reactive({ |
| | | userName: store.state.userInfo?.userName || "", // ä»ä¿çä»storeåå¼ï¼å¯æå¨ä¿®æ¹ |
| | | oldPwd: "", |
| | | newPwd: "", |
| | | confirmPassword: "", |
| | | }); |
| | | |
| | | // å
¨å±æç¤º |
| | | let appContext = getCurrentInstance().appContext; |
| | | let $message = appContext.config.globalProperties.$message; |
| | | |
| | | // å车触å |
| | | const changePwdPress = (e) => { |
| | | if (e.keyCode === 13) { |
| | | changePassword(); |
| | | } |
| | | }; |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | router.go(-1); |
| | | }; |
| | | |
| | | // è¡¨åæ ¡éªï¼æ°å¢ï¼ç¨æ·åéç©ºæ ¡éªï¼ |
| | | const validateForm = () => { |
| | | if (!pwdForm.userName) return $message.error("请è¾å
¥ç¨æ·å"); // æ°å¢ |
| | | if (!pwdForm.oldPwd) return $message.error("请è¾å
¥æ§å¯ç "); |
| | | if (!pwdForm.newPwd) return $message.error("请è¾å
¥æ°å¯ç "); |
| | | if (pwdForm.newPwd.length < 6) { |
| | | $message.error("æ°å¯ç é¿åº¦ä¸è½å°äº6ä½"); |
| | | return false; |
| | | } |
| | | if (pwdForm.newPwd !== pwdForm.confirmPassword) { |
| | | $message.error("两次è¾å
¥çæ°å¯ç ä¸ä¸è´"); |
| | | return false; |
| | | } |
| | | if (pwdForm.oldPwd === pwdForm.newPwd) { |
| | | $message.error("æ°å¯ç ä¸è½ä¸æ§å¯ç ç¸å"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | // ä¿®æ¹å¯ç ï¼é»è¾ä¸åï¼userNameå·²å¨è¡¨åä¸ï¼ |
| | | const changePassword = () => { |
| | | if (!validateForm()) return; |
| | | |
| | | loading.value = true; |
| | | http.post("/api/User/ModifyUserNamePwd", { |
| | | userName: pwdForm.userName, |
| | | newPwd: pwdForm.newPwd, |
| | | oldPwd: pwdForm.oldPwd |
| | | }, "æ£å¨ä¿®æ¹å¯ç ....").then((result) => { |
| | | loading.value = false; |
| | | if (!result.status) return $message.error(result.message); |
| | | |
| | | $message.success("å¯ç ä¿®æ¹æåï¼è¯·éæ°ç»å½"); |
| | | store.commit("clearUserInfo", ""); |
| | | setTimeout(() => router.push("/login"), 1500); |
| | | }).catch((err) => { |
| | | loading.value = false; |
| | | $message.error("ä¿®æ¹å¯ç 失败ï¼è¯·è系管çå"); |
| | | }); |
| | | }; |
| | | |
| | | return { |
| | | loading, |
| | | pwdForm, |
| | | changePassword, |
| | | changePwdPress, |
| | | goBack, |
| | | }; |
| | | }, |
| | | directives: { |
| | | focus: { |
| | | inserted: function (el) { |
| | | el.focus(); |
| | | }, |
| | | }, |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | // å®å
¨å¤ç¨ä½ ç»å½é¡µçæ ·å¼ï¼åªæ°å¢å°éæé®æ ·å¼ |
| | | .login-container { |
| | | display: flex; |
| | | width: 100%; |
| | | height: 100%; |
| | | background: rgb(246, 247, 252); |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | } |
| | | |
| | | .login-form { |
| | | align-items: center; |
| | | width: 50%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | z-index: 999; |
| | | |
| | | .form-user { |
| | | .item { |
| | | border-radius: 5px; |
| | | border: 1px solid #ececec; |
| | | display: flex; |
| | | margin-bottom: 30px; |
| | | background: #ffff; |
| | | height: 45px; |
| | | padding-left: 20px; |
| | | align-items: center; |
| | | |
| | | .input-icon { |
| | | color: #7a7a7a; |
| | | padding-right: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | } |
| | | |
| | | input:-webkit-autofill { |
| | | box-shadow: 0 0 0px 1000px white inset; |
| | | -webkit-box-shadow: 0 0 0px 1000px white inset !important; |
| | | } |
| | | |
| | | input { |
| | | background: white; |
| | | display: block; |
| | | box-sizing: border-box; |
| | | width: 100%; |
| | | min-width: 0; |
| | | margin: 0; |
| | | padding: 0; |
| | | color: #323233; |
| | | text-align: left; |
| | | border: 0; |
| | | outline: none; |
| | | font-size: 16px; |
| | | height: 100%; |
| | | line-height: normal; |
| | | } |
| | | } |
| | | |
| | | .form-user, |
| | | .loging-btn { |
| | | width: 400px; |
| | | } |
| | | |
| | | .loging-btn { |
| | | box-shadow: 2px 4px 11px #a4c2ff; |
| | | margin-top: 10px; |
| | | |
| | | button { |
| | | padding: 21px; |
| | | font-size: 14px !important; |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | // ä»
æ°å¢ï¼è¿åæé®æ ·å¼ |
| | | .back-login-btn { |
| | | width: 400px; |
| | | margin-top: 15px; |
| | | text-align: center; |
| | | |
| | | button { |
| | | font-size: 13px; |
| | | color: #3a6cd1; |
| | | padding: 0; |
| | | |
| | | &:hover { |
| | | color: #1850c1; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .login-text { |
| | | font-weight: bolder; |
| | | font-size: 20px; |
| | | letter-spacing: 2px; |
| | | position: relative; |
| | | display: flex; |
| | | } |
| | | |
| | | .login-text-small { |
| | | margin-bottom: 20px; |
| | | font-size: 13px; |
| | | color: #7d7c7c; |
| | | } |
| | | |
| | | .login-bg { |
| | | left: 0; |
| | | position: absolute; |
| | | height: 100%; |
| | | width: 50%; |
| | | z-index: 0; |
| | | } |
| | | |
| | | .project-name { |
| | | position: absolute; |
| | | top: 40px; |
| | | left: 40px; |
| | | z-index: 9999; |
| | | font-weight: bolder; |
| | | background-image: linear-gradient(to right, #1850c1, #9c009c); |
| | | -webkit-background-clip: text; |
| | | color: transparent; |
| | | font-size: 25px; |
| | | } |
| | | |
| | | // ååºå¼éé
ï¼å¤ç¨ä½ çé»è¾ï¼ |
| | | @media screen and (max-width: 700px) { |
| | | .login-bg, |
| | | .project-name { |
| | | display: none; |
| | | } |
| | | |
| | | .login-container { |
| | | padding: 2rem; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .login-form { |
| | | width: 100%; |
| | | } |
| | | |
| | | .form-user, |
| | | .loging-btn, |
| | | .back-login-btn { |
| | | width: 100%; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <el-option v-for="item in stationOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </div> |
| | | |
| | | |
| | | |
| | | </div> |
| | | <div class="loging-btn"> |
| | | <el-button size="large" :loading="loading" color="#3a6cd1" :dark="true" @click="login" long> |
| | | <span v-if="!loading">ç»å½</span> |
| | | <span v-else>æ£å¨ç»å½...</span> |
| | | </el-button> |
| | | </div> |
| | | <!-- æ°å¢ï¼ä¿®æ¹å¯ç æé®ï¼æ ·å¼ä¸ç»å½é¡µç»ä¸ï¼ --> |
| | | <div class="change-pwd-btn"> |
| | | <el-button size="large" type="text" @click="goChangePassword" long> |
| | | <span style="color: #3a6cd1; font-size: 13px;">ä¿®æ¹å¯ç </span> |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | |
| | | let $message = appContext.config.globalProperties.$message; |
| | | let router = useRouter(); |
| | | |
| | | // æ°å¢ï¼è·³è½¬å°ä¿®æ¹å¯ç é¡µé¢ |
| | | const goChangePassword = () => { |
| | | router.push({ path: "/change-password" }); |
| | | }; |
| | | |
| | | const login = () => { |
| | | if (!userInfo.userName) return $message.error("请è¾å
¥ç¨æ·å"); |
| | | if (!userInfo.password) return $message.error("请è¾å
¥å¯ç "); |
| | |
| | | getVierificationCode(); |
| | | return $message.error(result.message); |
| | | } |
| | | $message.success("ç»å½æå,æ£å¨è·³è½¬!"); |
| | | $message.success(result.message); |
| | | store.commit("setUserInfo", result.data); |
| | | |
| | | router.push({ path: "/" }); |
| | |
| | | stationOptions, |
| | | stationValue, |
| | | handleStationChange, |
| | | goChangePassword // æ°å¢ï¼æ´é²è·³è½¬æ¹æ³ |
| | | }; |
| | | }, |
| | | directives: { |
| | |
| | | padding: 21px; |
| | | font-size: 14px !important; |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ï¼ä¿®æ¹å¯ç æé®æ ·å¼ï¼ä¸ç»å½é¡µé£æ ¼ç»ä¸ï¼ |
| | | .change-pwd-btn { |
| | | width: 400px; |
| | | margin-top: 15px; |
| | | text-align: center; |
| | | |
| | | button { |
| | | font-size: 13px; |
| | | padding: 0; |
| | | |
| | | &:hover { |
| | | color: #1850c1 !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .form-user, |
| | | .loging-btn { |
| | | .loging-btn, |
| | | .change-pwd-btn { // æ°å¢ï¼ååºå¼éé
ä¿®æ¹å¯ç æé® |
| | | width: 100%; |
| | | } |
| | | } |
| | |
| | | inboundOrderNo: "", |
| | | upperOrderNo: "", |
| | | remark: "", |
| | | orderStatus: "", |
| | | warehouseId: "", |
| | | supplierId: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | |
| | | type: "select", |
| | | dataKey: "inOrderType", |
| | | data: [], |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "inboundOrderNo", |
| | |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "orderDetailStatus", |
| | |
| | | { title: "åºåºåæ¡ç ", field: "originalSerilNumber", type: "like" }, |
| | | { title: "æå
æ°æ¡ç ", field: "newSerilNumber", type: "like" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | { title: "ä»åºå·", field: "warehouseCode", type: "like" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseCode", |
| | | title: "ä»åº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models.Config; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public class PasswordPolicyConfigService : ServiceBase<PasswordPolicyConfig, IRepository<PasswordPolicyConfig>>, IPasswordPolicyConfigService |
| | | { |
| | | public PasswordPolicyConfigService(IRepository<PasswordPolicyConfig> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åå¯ç çç¥é
ç½®ï¼ä»AppSettings读åï¼ |
| | | /// </summary> |
| | | public PasswordPolicyConfig GetConfigValue(string key = "") |
| | | { |
| | | try |
| | | { |
| | | // ä»appsettings.jsonçPasswordPolicyèç¹è¯»åé
ç½® |
| | | var config = new PasswordPolicyConfig |
| | | { |
| | | EnablePasswordExpire = AppSettings.Get(new[] { "PasswordPolicy", "EnablePasswordExpire" }).ObjToBool(), |
| | | PasswordExpireDays = AppSettings.Get(new[] { "PasswordPolicy", "PasswordExpireDays" }).ObjToInt(90), |
| | | RemindBeforeExpireDays = AppSettings.Get(new[] { "PasswordPolicy", "RemindBeforeExpireDays" }).ObjToInt(7) |
| | | }; |
| | | return config; |
| | | } |
| | | catch |
| | | { |
| | | // 读å失败è¿åé»è®¤é
ç½® |
| | | return new PasswordPolicyConfig(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | using Microsoft.Extensions.Caching.Memory; |
| | | using Microsoft.Extensions.Caching.Memory; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using SqlSugar; |
| | | using StackExchange.Profiling; |
| | |
| | | public string UserTrueName { get; set; } |
| | | |
| | | public string HeadImageUrl { get; set; } |
| | | |
| | | public DateTime? PwdLastModifyTime { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Model.Models.Config; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface IPasswordPolicyConfigService : IService<PasswordPolicyConfig> |
| | | { |
| | | /// <summary> |
| | | /// è·åå¯ç çç¥é
ç½® |
| | | /// </summary> |
| | | /// <param name="key">é¢çé®å¼ï¼éé
åææ¹æ³ç¾åï¼</param> |
| | | /// <returns>å¯ç çç¥é
ç½®</returns> |
| | | PasswordPolicyConfig GetConfigValue(string key = ""); |
| | | } |
| | | } |
| | |
| | | |
| | | WebResponseContent ModifyPwd(string oldPwd, string newPwd); |
| | | WebResponseContent ModifyUserPwd(string password, string userName); |
| | | |
| | | WebResponseContent ModifyUserNamePwd(string oldPassword, string userName,string newPassword); |
| | | } |
| | | } |
| | |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | // æºè½è¯å«è¾å
¥ç±»å |
| | | |
| | | string palletCode = null; |
| | | string barcode = null; |
| | | int stockStatus = 0; |
| | | |
| | | // 1. å
å°è¯ææçå·æ¥è¯¢ |
| | | var stockByPallet = _stockRepository.Db.Queryable<Dt_StockInfo>() |
| | |
| | | { |
| | | // è¯å«ä¸ºæçå· |
| | | palletCode = code; |
| | | stockStatus = stockByPallet.StockStatus; |
| | | |
| | | var task =_taskRepository.Db.Queryable<Dt_Task>().Where(t => t.PalletCode == palletCode).ToList(); |
| | | if(task!=null && task.Any()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçå· {palletCode} å卿ªå®æçä»»å¡ï¼æ æ³æ¤é"); |
| | | } |
| | | |
| | | if (stockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçå· {palletCode} å¤äºå
¥åºç¡®è®¤ç¶æï¼ç¦æ¢æ´æçæ¤éï¼è¯·åç¬æ¤éæ¡ç "); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | barcode = code; |
| | | palletCode = stockInfo.PalletCode; |
| | | stockStatus = stockInfo.StockStatus; |
| | | } |
| | | } |
| | | else |
| | |
| | | return WebResponseContent.Instance.Error($"æç {palletCode} 䏿ªæ¾å°æ¡ç {barcode} çæç»è®°å½"); |
| | | } |
| | | |
| | | if (stockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()) |
| | | { |
| | | var totalDetails = stock.Details?.Count ?? 0; |
| | | if (totalDetails <= 1) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error($"æç {palletCode} å¤äºå
¥åºç¡®è®¤ç¶æï¼å½åä»
å©ä½æå1æ¡æç»ï¼ç¦æ¢æ¤éï¼å¿
é¡»ä¿çè³å°1æ¡åºåæç»ï¼"); |
| | | } |
| | | } |
| | | |
| | | ResetInboundOrderStatus(new List<string> { targetDetail.OrderNo }, new List<string> { targetDetail.Barcode }); |
| | | _stockDetailRepository.DeleteData(targetDetail); |
| | | |
| | |
| | | |
| | | if (!remainingDetails.Any()) |
| | | { |
| | | if (stockStatus == (int)StockStatusEmun.ç»çæå) |
| | | { |
| | | ResetInboundOrderStatus(stock.Details.Select(d => d.OrderNo).Distinct().ToList()); |
| | | _stockRepository.DeleteData(stock); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK($"æ¡ç {barcode} æ¤éæåï¼æçæ å©ä½æç»ï¼å·²å 餿çå¹¶éç½®å
³èå
¥åºåç¶æ"); |
| | | return WebResponseContent.Instance.OK($"æ¡ç {barcode} æ¤éæåï¼æçæ å©ä½æç»ï¼å·²éç½®å
³èå
¥åºåç¶æ"); |
| | | } |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | |
| | | } |
| | | else |
| | | { |
| | | // ===== æ¤éæ´ä¸ªæç ===== |
| | | var stock = _stockRepository.Db.Queryable<Dt_StockInfo>() |
| | | .Includes(o => o.Details) |
| | | .First(x => x.PalletCode == palletCode |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Model.Models.Config |
| | | { |
| | | public class PasswordPolicyConfig |
| | | { |
| | | /// <summary> |
| | | /// æ¯å¦å¯ç¨å¯ç è¿æçç¥ |
| | | /// </summary> |
| | | public bool EnablePasswordExpire { get; set; } = true; |
| | | |
| | | /// <summary> |
| | | /// å¯ç æææï¼å¤©ï¼ |
| | | /// </summary> |
| | | public int PasswordExpireDays { get; set; } = 90; |
| | | |
| | | /// <summary> |
| | | /// æåæéå¤©æ° |
| | | /// </summary> |
| | | public int RemindBeforeExpireDays { get; set; } = 7; |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// æåå¯ç ä¿®æ¹æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, IsOnlyIgnoreInsert = true, ColumnDescription = "æåå¯ç ä¿®æ¹æ¶é´")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æåå¯ç ä¿®æ¹æ¶é´")] |
| | | public DateTime? LastModifyPwdDate { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | BarcodeQty = item.OrderQuantity, |
| | | BarcodeUnit = item.Unit, |
| | | }; |
| | | var issueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeQty); |
| | | outboundOrderDetail.Unit = issueoStockResult.Unit; |
| | | outboundOrderDetail.OrderQuantity = issueoStockResult.Quantity; |
| | | var moveissueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeMoveQty); |
| | | outboundOrderDetail.MoveQty = moveissueoStockResult.Quantity; |
| | | var unitConvertResult = await ConvertUnitAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeQty, item.BarcodeMoveQty); |
| | | outboundOrderDetail.Unit = unitConvertResult.Unit; |
| | | outboundOrderDetail.OrderQuantity = unitConvertResult.OrderQuantity; |
| | | outboundOrderDetail.MoveQty = unitConvertResult.MoveQty; |
| | | |
| | | outboundOrderDetail.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? ""; |
| | | outboundOrderDetails.Add(outboundOrderDetail); |
| | | } |
| | | else |
| | | { |
| | | var unitConvertResult = await ConvertUnitAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeQty, item.BarcodeMoveQty); |
| | | #region éå®ç¶æä¸éæ°éåæ®µä¸è´æ§æ ¡éª |
| | | if (outboundOrderDetail.LockQuantity != 0) |
| | | { |
| | | var isFieldChanged = !string.Equals(outboundOrderDetail.MaterielCode, item.MaterielCode) |
| | | || !string.Equals(outboundOrderDetail.SupplyCode, item.SupplyCode) |
| | | || !string.Equals(outboundOrderDetail.BatchNo, item.BatchNo) |
| | | || !string.Equals(outboundOrderDetail.Unit, item.Unit) |
| | | || !string.Equals(outboundOrderDetail.Unit, unitConvertResult.Unit) |
| | | || !string.Equals(outboundOrderDetail.WarehouseCode, item.WarehouseCode) |
| | | || !string.Equals(outboundOrderDetail.lineNo, item.lineNo) |
| | | ; |
| | |
| | | outboundOrderDetail.BarcodeMoveQty = item.MoveQty; |
| | | outboundOrderDetail.BarcodeQty = item.OrderQuantity; |
| | | outboundOrderDetail.BarcodeUnit = item.Unit; |
| | | |
| | | var issueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeQty); |
| | | outboundOrderDetail.Unit = issueoStockResult.Unit; |
| | | outboundOrderDetail.OrderQuantity = issueoStockResult.Quantity; |
| | | var moveissueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeMoveQty); |
| | | outboundOrderDetail.MoveQty = moveissueoStockResult.Quantity; |
| | | outboundOrderDetail.Unit = unitConvertResult.Unit; |
| | | outboundOrderDetail.OrderQuantity = unitConvertResult.OrderQuantity; |
| | | outboundOrderDetail.MoveQty = unitConvertResult.MoveQty; |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | return new PageGridData<Dt_OutboundOrder>(totalCount, data); |
| | | } |
| | | |
| | | |
| | | private async Task<UnitConvertResult> ConvertUnitAsync(string materielCode, string barcodeUnit, decimal barcodeQty, decimal barcodeMoveQty) |
| | | { |
| | | var issueoStockResult = await _materialUnitService.ConvertFromToStockAsync(materielCode, barcodeUnit, barcodeQty); |
| | | var moveissueoStockResult = await _materialUnitService.ConvertFromToStockAsync(materielCode, barcodeUnit, barcodeMoveQty); |
| | | |
| | | return new UnitConvertResult |
| | | { |
| | | Unit = issueoStockResult.Unit, |
| | | OrderQuantity = issueoStockResult.Quantity, |
| | | MoveQty = moveissueoStockResult.Quantity |
| | | }; |
| | | } |
| | | |
| | | private class UnitConvertResult |
| | | { |
| | | public string Unit { get; set; } |
| | | public decimal OrderQuantity { get; set; } |
| | | public decimal MoveQty { get; set; } |
| | | } |
| | | } |
| | | } |
| | |
| | | Creater = stockDetail.Creater, |
| | | CreateDate = stockDetail.CreateDate, |
| | | WarehouseCode = stockDetail.WarehouseCode, |
| | | ValidDate = stockDetail.ValidDate, |
| | | Remark = $"åºåºå®æå é¤ï¼æ¡ç ï¼{request.Barcode}ï¼åæ°éï¼{stockDetail.StockQuantity}ï¼åºåºæ°éï¼{actualOutboundQuantity}ï¼æä½è
ï¼{request.Operator}" |
| | | }; |
| | | _stockDetailHistoryRepository.AddData(historyRecord); |
| | |
| | | x.Barcode == request.Barcode && |
| | | |
| | | (x.OperateType == "åºåºå®æ" || x.OperateType == "æå
-åå§è®°å½")); |
| | | if (historyDetail == null) |
| | | |
| | | if(historyDetail != null) |
| | | { |
| | | response.Success = false; |
| | | response.Message = $"æ¡ç {request.Barcode} å·²æå
ï¼æ æ³æ¤é"; |
| | | return WebResponseContent.Instance.Error(response.Message); |
| | | double minutesDiff = (DateTime.Now - historyDetail.InsertTime).TotalMinutes; |
| | | if (minutesDiff >= 30) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æ¡ç {request.Barcode}å·²æ æ³æ¤é"); |
| | | } |
| | | } |
| | | |
| | | Dt_OutStockLockInfo lockInfo = _outboundLockInfoRepository.QueryFirst(x => |
| | |
| | | using MailKit.Search; |
| | | using OrderByType = SqlSugar.OrderByType; |
| | | using System.Drawing.Printing; |
| | | using WIDESEA_Model.Models.Config; |
| | | using WIDESEA_IBasicService; |
| | | //using WIDESEA_Core.HostedService; |
| | | |
| | | namespace WIDESEA_SystemService |
| | |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ISys_MenuService _menuService; |
| | | private readonly ISys_RoleService _roleService; |
| | | private readonly IPasswordPolicyConfigService _passwordPolicyConfigService; |
| | | |
| | | public IRepository<Sys_User> Repository => BaseDal; |
| | | |
| | | public Sys_UserService(IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, ISys_RoleService roleService) : base(repository) |
| | | public Sys_UserService(IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, ISys_RoleService roleService, IPasswordPolicyConfigService passwordPolicyConfigService) : base(repository) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _cacheService = cacheService; |
| | | _menuService = menuService; |
| | | _roleService = roleService; |
| | | _passwordPolicyConfigService = passwordPolicyConfigService; |
| | | } |
| | | |
| | | public WebResponseContent Login(LoginInfo loginInfo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | PasswordPolicyConfig passwordPolicy = null; |
| | | string token = null; |
| | | try |
| | | { |
| | | //BaseDal.QueryFirst(x => x.UserName == loginInfo.UserName); |
| | | passwordPolicy = _passwordPolicyConfigService.GetConfigValue("") ?? new PasswordPolicyConfig(); |
| | | |
| | | string msg = string.Empty; |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | UserInfo user = BaseDal.QueryFirst(x => x.UserName == loginInfo.UserName && x.UserPwd == loginInfo.Password, x => new UserInfo { HeadImageUrl = x.HeadImageUrl, RoleId = x.RoleId, TenantId = x.TenantId, UserId = x.UserId, UserName = x.UserName, UserTrueName = x.UserTrueName }); |
| | | UserInfo user = BaseDal.QueryFirst(x => x.UserName == loginInfo.UserName && x.UserPwd == loginInfo.Password, x => new UserInfo { HeadImageUrl = x.HeadImageUrl, RoleId = x.RoleId, TenantId = x.TenantId, UserId = x.UserId, UserName = x.UserName, UserTrueName = x.UserTrueName,PwdLastModifyTime = x.LastModifyPwdDate }); |
| | | if (user != null) |
| | | { |
| | | // 3. å¯ç è¿æçç¥æ£æ¥ï¼ä»
å¯ç¨æ¶æ§è¡ï¼ |
| | | if (passwordPolicy.EnablePasswordExpire) |
| | | { |
| | | DateTime pwdModifyTime = user.PwdLastModifyTime ?? DateTime.Now.AddYears(-1); |
| | | TimeSpan passwordAge = DateTime.Now - pwdModifyTime; |
| | | int daysToExpire = passwordPolicy.PasswordExpireDays - (int)passwordAge.TotalDays; |
| | | |
| | | // å¯ç å·²è¿æï¼å¼ºå¶æ¹å¯ |
| | | if (daysToExpire <= 0) |
| | | { |
| | | return WebResponseContent.Instance.Error( |
| | | "æ¨çå¯ç å·²è¿æï¼è¯·å
ä¿®æ¹å¯ç ååç»å½", |
| | | data: new { needChangePwd = true, userId = user.UserId }); |
| | | } |
| | | |
| | | // å¯ç å³å°è¿æï¼ç»å½æåå¹¶æé |
| | | if (daysToExpire <= passwordPolicy.RemindBeforeExpireDays) |
| | | { |
| | | token = JwtHelper.IssueJwt(new TokenModelJwt() |
| | | { |
| | | UserId = user.UserId, |
| | | RoleId = user.RoleId, |
| | | UserName = user.UserName, |
| | | TenantId = user.TenantId, |
| | | }); |
| | | App.User.UpdateToke(token, user.UserId); |
| | | |
| | | content = WebResponseContent.Instance.OK( |
| | | message: $"æ¨çå¯ç å°å¨{daysToExpire}天åè¿æï¼è¯·åæ¶ä¿®æ¹", |
| | | data: new |
| | | { |
| | | token, |
| | | userName = user.UserName, |
| | | img = user.HeadImageUrl, |
| | | UserTrueName = user.UserTrueName, |
| | | needChangePwd = false, |
| | | pwdWillExpire = true, |
| | | daysToExpire = daysToExpire |
| | | }); |
| | | return content; |
| | | } |
| | | } |
| | | object obj = _menuService.GetMenuActionList(user.RoleId); |
| | | if (obj is not IEnumerable<object> list) |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error("æ ç»å½æé"); |
| | | } |
| | | |
| | | string token = JwtHelper.IssueJwt(new TokenModelJwt() |
| | | token = JwtHelper.IssueJwt(new TokenModelJwt() |
| | | { |
| | | UserId = user.UserId, |
| | | RoleId = user.RoleId, |
| | |
| | | //if (PermissionDataHostService.UserRoles.FirstOrDefault(x => x.UserId == user.UserId) == null) |
| | | // PermissionDataHostService.UserRoles.AddRange(PermissionDataHostService.GetUserRoles(Db, user.UserId)); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: new { token, userName = user.UserName, img = user.HeadImageUrl, user.UserTrueName }); |
| | | content = WebResponseContent.Instance.OK(message: "ç»å
¥æå,æ£å¨è·³è½¬é¡µé¢", data: new { token, userName = user.UserName, img = user.HeadImageUrl, user.UserTrueName, needChangePwd = false, |
| | | pwdWillExpire = false, |
| | | daysToExpire = passwordPolicy.EnablePasswordExpire |
| | | ? passwordPolicy.PasswordExpireDays - (int)(DateTime.Now - (user.PwdLastModifyTime ?? DateTime.Now)).TotalDays |
| | | : 0 |
| | | }); |
| | | } |
| | | else |
| | | { |
| | |
| | | string pwd = "123456"; |
| | | string uesrName = saveModel.MainData[nameof(Sys_User.UserName).FirstLetterToLower()].ToString(); |
| | | saveModel.MainData[nameof(Sys_User.UserPwd).FirstLetterToLower()] = pwd.EncryptDES(AppSecret.User); |
| | | |
| | | string pwdModifyTimeField = nameof(Sys_User.LastModifyPwdDate).FirstLetterToLower(); |
| | | saveModel.MainData[pwdModifyTimeField] = DateTime.Now; |
| | | |
| | | WebResponseContent content = base.AddData(saveModel); |
| | | if (content.Status) |
| | |
| | | Sys_User user = BaseDal.QueryFirst(x => x.UserName == userName); |
| | | if (user == null) return WebResponseContent.Instance.Error("ç¨æ·ä¸åå¨"); |
| | | user.UserPwd = password.EncryptDES(AppSecret.User); |
| | | user.LastModifyPwdDate = DateTime.Now; |
| | | BaseDal.UpdateData(user); |
| | | if (App.User.UserId == user.UserId) |
| | | { |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent ModifyUserNamePwd(string userName,string oldPwd, string password) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | string message = ""; |
| | | // å»é¤é¦å°¾ç©ºæ ¼ï¼ç©ºå¼å¤ç |
| | | oldPwd = oldPwd?.Trim(); |
| | | password = password?.Trim(); |
| | | userName = userName?.Trim(); |
| | | |
| | | try |
| | | { |
| | | // 1. åºç¡åæ°æ ¡éª |
| | | if (string.IsNullOrEmpty(userName)) return WebResponseContent.Instance.Error("ç¨æ·åä¸è½ä¸ºç©º"); |
| | | if (string.IsNullOrEmpty(oldPwd)) return WebResponseContent.Instance.Error("æ§å¯ç ä¸è½ä¸ºç©º"); |
| | | if (string.IsNullOrEmpty(password)) return WebResponseContent.Instance.Error("æ°å¯ç ä¸è½ä¸ºç©º"); |
| | | if (oldPwd == password) return WebResponseContent.Instance.Error("æ°å¯ç ä¸è½ä¸æ§å¯ç ç¸å"); |
| | | if (password.Length < 6) return WebResponseContent.Instance.Error("æ°å¯ç é¿åº¦ä¸è½å°äº6ä½"); |
| | | |
| | | // 2. è·åç¨æ·ä¿¡æ¯ |
| | | Sys_User user = BaseDal.QueryFirst(x => x.UserName == userName); |
| | | if (user == null) return WebResponseContent.Instance.Error("ç¨æ·ä¸åå¨"); |
| | | |
| | | // 3. æ ¡éªæ§å¯ç ï¼è§£å¯å对æ¯ï¼ |
| | | string decryptedOldPwd = user.UserPwd.DecryptDES(AppSecret.User); // è§£å¯æ°æ®åºä¸çå¯ç |
| | | if (decryptedOldPwd != oldPwd) // 对æ¯åå§æ§å¯ç |
| | | { |
| | | return WebResponseContent.Instance.Error("æ§å¯ç è¾å
¥é误"); |
| | | } |
| | | |
| | | // 4. æ´æ°å¯ç åç¸å
³ä¿¡æ¯ |
| | | user.UserPwd = password.EncryptDES(AppSecret.User); // å 坿°å¯ç |
| | | user.LastModifyPwdDate = DateTime.Now; |
| | | BaseDal.UpdateData(user); |
| | | |
| | | // 5. 妿æ¯å½åç»å½ç¨æ·ï¼éæ°çæJWT Tokenå¹¶æ´æ°ç¼å |
| | | if (App.User.UserId == user.UserId) |
| | | { |
| | | string token = JwtHelper.IssueJwt(new TokenModelJwt() |
| | | { |
| | | UserId = user.UserId, |
| | | RoleId = user.RoleId, |
| | | UserName = user.UserName, |
| | | TenantId = user.TenantId, |
| | | }); |
| | | _cacheService.AddOrUpdate(user.UserId.ToString(), token); |
| | | } |
| | | |
| | | // 6. è¿åæåç»æ |
| | | return content.OK("å¯ç ä¿®æ¹æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | message = ex.Message; // è®°å½å¼å¸¸ä¿¡æ¯ï¼å»ºè®®è¡¥å
æ¥å¿æ¡æ¶è®°å½ï¼ |
| | | content.Error("æå¡å¨åºäºç¹é®é¢,请ç¨ååè¯"); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ISystemService\WIDESEA_ISystemService.csproj" /> |
| | | </ItemGroup> |
| | | |
| | |
| | | .Where(x => x.OrderNo == stockLockInfo.OrderNo) |
| | | .Includes(x => x.Details) |
| | | .First(); |
| | | |
| | | string Operator = outboundOrder.Modifier; |
| | | if (outboundOrder != null) |
| | | { |
| | | var allocatInfo =_allocateMaterialInfo.Db.Queryable<Dt_AllocateMaterialInfo>().Where(x => x.OrderNo == outboundOrder.OrderNo).ToList(); |
| | |
| | | } |
| | | |
| | | // 7. åè°MES |
| | | string Operator = outboundOrder.Modifier; |
| | | |
| | | HttpResponseResult<MesResponseDTO> httpResponseResult = new HttpResponseResult<MesResponseDTO>(); |
| | | string reqCode = Guid.NewGuid().ToString(); |
| | | string reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | } |
| | | Dt_OutboundOrder outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x=>x.Details).First(); |
| | | |
| | | |
| | | string Operator = outboundOrder.Modifier; |
| | | if (outboundOrder != null) |
| | | { |
| | | foreach (var item in stockInfo.Details.Where(x => x.OrderNo == outboundOrder.OrderNo).ToList()) |
| | |
| | | _outboundOrderService.UpdateData(outboundOrder); |
| | | } |
| | | } |
| | | string Operator = outboundOrder.Modifier; |
| | | |
| | | ///åè°MES |
| | | HttpResponseResult<MesResponseDTO> httpResponseResult = new HttpResponseResult<MesResponseDTO>(); |
| | | string reqCode = Guid.NewGuid().ToString(); |
| | |
| | | return Service.GetCurrentUserInfo(); |
| | | } |
| | | |
| | | [HttpPost, Route("modifyPwd")] |
| | | [HttpPost, Route("modifyPwd"), AllowAnonymous] |
| | | public IActionResult ModifyPwd(string oldPwd, string newPwd) |
| | | { |
| | | return Json(Service.ModifyPwd(oldPwd, newPwd)); |
| | | } |
| | | |
| | | [HttpPost, Route("ModifyUserNamePwd"), AllowAnonymous] |
| | | public IActionResult ModifyUserNamePwd([FromBody] ModifyUserNamePwd modifyUserName) |
| | | { |
| | | return Json(Service.ModifyUserNamePwd(modifyUserName.userName, modifyUserName.oldPwd, modifyUserName.newPwd)); |
| | | } |
| | | |
| | | [HttpGet, Route("getVierificationCode"), AllowAnonymous] |
| | |
| | | public string name { get; set; } |
| | | public string pwd { get; set; } |
| | | } |
| | | |
| | | public class ModifyUserNamePwd |
| | | { |
| | | public string userName { get; set; } |
| | | public string oldPwd { get; set; } |
| | | public string newPwd { get; set; } |
| | | } |
| | | } |