Browse Source

Merge remote-tracking branch 'origin/master' into master

yaoyq 2 years ago
parent
commit
b635763aa8

+ 1 - 1
imcs-bt-be/imcs-authority-server/src/main/java/com/github/zuihou/api/OpsAppApi.java

@@ -255,7 +255,7 @@ public class OpsAppApi {
         BaseContextHandler.setTenant("0000");
         LambdaUpdateWrapper<EquBarrel> updateWrapper = new LambdaUpdateWrapper();
         updateWrapper.set(EquBarrel::getMtrId, equRecord.getReplaceMaterial()).set(EquBarrel::getMtrName, equRecord.getMtName()).set(EquBarrel::getMtrResidue, equRecord.getSpecs())
-                .set(EquBarrel::getExprTime, equRecord.getDate()).eq(EquBarrel::getId, equRecord.getMaterialId());
+                .set(StringUtil.isNotEmpty(equRecord.getDate()), EquBarrel::getExprTime, DateUtils.getStartTime(equRecord.getDate())).eq(EquBarrel::getId, equRecord.getMaterialId());
         Boolean bool = equBarrelService.update(null, updateWrapper);
         if(bool){
             bool = equRecordService.save(equRecord);

+ 5 - 5
imcs-bt-be/imcs-business-biz/src/main/resources/mapper_business/base/barrel/EquBarrelMapper.xml

@@ -25,16 +25,16 @@
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id,create_time,create_user,update_time,update_user,barrel_code,barrel_type,
-        equ_id, mtr_id, mtr_name, mtr_type, mtr_unit, mtr_residue, residue_warn, expr_time, expr_war_days,expr_Status, barrel_weight
+        equ_id, mtr_id, mtr_name, mtr_type, mtr_unit, mtr_residue, residue_warn, expr_time, expr_war_days, barrel_weight, org_id
     </sql>
 
     <select id="pageList" resultMap="BaseResultMap" parameterType="String">
         select
-        <include refid="Base_Column_List"/>
+        <include refid="Base_Column_List"/>, IF(<![CDATA[ interval_day < 0 ]]>,'1','0') as expr_Status, IF(<![CDATA[ interval_day <= expr_war_days ]]>,'1','0') as expr_close_status
         from (
-        select b.id, b.create_time,b.create_user,b.update_time,b.update_user,b.barrel_code,b.barrel_type,b.equ_id, b.mtr_id, b.mtr_residue, b.residue_warn, b.expr_time, b.expr_war_days,b.expr_Status, b.barrel_weight, m.mt_name as mtr_name,m.mt_type as mtr_type, m.mt_unit as mtr_unit, p.org_id from bt_equ_barrel b left join bt_material m on b.mtr_id = m.id
-        left join imcs_tenant_productionresource p on b.equ_id = p.id
-
+        select b.id, b.create_time,b.create_user,b.update_time,b.update_user,b.barrel_code,b.barrel_type,b.equ_id, b.mtr_id, b.mtr_residue, b.expr_time, b.barrel_weight, m.mt_name as mtr_name,m.mt_type as mtr_type, m.mt_rep_war as residue_warn,m.mt_due_war as expr_war_days, TIMESTAMPDIFF(
+        DAY, now(), b.expr_time) as interval_day,m.mt_unit as mtr_unit, p.org_id from bt_equ_barrel b
+        left join bt_material m on b.mtr_id = m.id and m.mt_use_sta='1' left join imcs_tenant_productionresource p on b.equ_id = p.id
         ) f ${ew.customSqlSegment}
     </select>
 

+ 2 - 0
imcs-bt-be/imcs-business-biz/src/main/resources/mapper_business/base/order/OrderMapper.xml

@@ -153,6 +153,7 @@
         <if test="id != null">
             and o.id = #{id}
         </if>
+            and o.order_status='SUCCESS'
         union
         select 0 as num1,0 as num2,count(1) as num3,0 as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
         <if test="orgIds != null and orgIds != ''">
@@ -165,6 +166,7 @@
         <if test="id != null">
             and o.id = #{id}
         </if>
+            and o.order_status='SUCCESS'
         union
         select 0 as num1,0 as num2,0 as num3,sum(o.order_amount) as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
         <if test="orgIds != null and orgIds != ''">

+ 11 - 0
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/barrel/entity/EquBarrel.java

@@ -151,6 +151,17 @@ public class EquBarrel extends Entity<Long> {
     @Excel(name = "过期状态")
     private String exprStatus;
 
+
+    /**
+     * 过期状态
+     */
+    @ApiModelProperty(value = "即将过期状态")
+    @Length(max = 10, message = "即将过期状态长度不能超过10")
+    @TableField(exist = false)
+    @Excel(name = "即将过期状态")
+    private String exprCloseStatus;
+
+
     /**
      * 权重
      */

+ 17 - 5
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/material/cup.vue

@@ -15,8 +15,9 @@
 								:style="{ height: Math.round(item.mtrResidue) + '%', backgroundColor:'#ff0000'}" v-else>
 								<view class="progress-view"></view>
 							</view>
-							<text class="errMsg" v-if="item.exprStatus==='1'">即将到期</text>
-							<text class="errMsg" v-if="item.mtrResidue <= item.residueWarn">原料不足</text>
+							{{item.mtrResidue}} {{item.residueWarn}}
+							<text class="expMsg" v-if="item.exprCloseStatus==='1' && item.exprStatus==='0' ">即将到期</text>							
+							<text class="errMsg" v-if="parseInt(item.mtrResidue) <= parseInt(item.residueWarn)">原料不足</text>
 							<text class="tip">{{parseInt(item.mtrResidue) || '0'}}个</text>
 						</view>
 
@@ -475,11 +476,22 @@
 
 	.grid-item-box .errMsg {
 		position: absolute;
-		left: 30%;
-		top: 120rpx;
+		left: 28%;
+		top: 180rpx;
+		font-size: 36rpx;
+		width: 80rpx;
+		color: #f0ad4e;
+		z-index: 9999;
+		margin: 0 auto;
+	}
+	
+	.grid-item-box .expMsg {
+		position: absolute;
+		left: 28%;
+		top: 60rpx;
 		font-size: 36rpx;
 		width: 80rpx;
-		color: #ff0000;
+		color: #f0ad4e;
 		z-index: 9999;
 		margin: 0 auto;
 	}

+ 32 - 12
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/material/material.vue

@@ -7,17 +7,17 @@
 						@click="inputDialogToggle(item)">
 						<text class="text">{{item.mtrName||'空'}}</text>
 						<view class="progressContainer">
-							<view class="progress" :style="{ height: Math.round(item.mtrResidue) + '%' }"
+							<view class="progress" :style="{ height: Math.round(item.mtrResidue/20) + '%' }"
 								v-if="item.exprStatus==='0'">
 								<view class="progress-view"></view>
 							</view>
 							<view class="progress"
-								:style="{ height: Math.round(item.mtrResidue) + '%', backgroundColor:'#ff0000'}" v-else>
+								:style="{ height: Math.round(item.mtrResidue/20) + '%', backgroundColor:'#ff0000'}" v-else>
 								<view class="progress-view"></view>
 							</view>
-							<text class="errMsg" v-if="item.exprStatus==='1'">即将到期</text>
-							<text class="errMsg" v-if="item.mtrResidue <= item.residueWarn">原料不足</text>
-							<text class="tip">{{item.mtrResidue || '0'}}ml</text>
+							<text class="expMsg" v-if="item.exprCloseStatus==='1' && item.exprStatus==='0' ">即将到期</text>
+							<text class="errMsg" v-if="parseInt(item.mtrResidue) <= parseInt(item.residueWarn)">原料不足</text>
+							<text class="tip">{{parseInt(item.mtrResidue) || '0'}}ml</text>
 						</view>
 
 						<view class="num">
@@ -96,7 +96,7 @@
 						</uni-col>
 						<uni-col :span="12">
 							<view class="uni-col light">{{material.mtrResidue || '0'}}ml
-								({{material.mtrResidue > material.residueWarn?'原料充足':'原料不足' }})</view>
+								({{parseInt(material.mtrResidue) > parseInt(material.residueWarn)?'原料充足':'原料不足' }})</view>
 						</uni-col>
 					</uni-row>
 					<uni-row class="uni-row">
@@ -143,7 +143,7 @@
 							<text style="line-height: 25px;height:25px;">{{form.mtName||'空'}}</text>
 						</uni-forms-item>
 						<uni-forms-item class="form-item" label="余量" name="surplus">
-							<uni-number-box :min="0" :max="100" v-model="form.surplus" :disabled="true">
+							<uni-number-box :min="0" :max="2000" v-model="form.surplus" :disabled="true">
 							</uni-number-box>
 						</uni-forms-item>
 						<uni-forms-item class="form-item" label="换料原料" name="replaceMaterial">
@@ -161,7 +161,7 @@
 							</picker>
 						</uni-forms-item>
 						<uni-forms-item class="form-item" label="换料规格" name="specs">
-							<uni-number-box :min="0" :max="100" v-model="form.specs"></uni-number-box>
+							<uni-number-box :min="0" :max="2000" v-model="form.specs"></uni-number-box>
 						</uni-forms-item>
 					</uni-forms>
 					<uni-row class="uni-row" style="margin-top: 200rpx">
@@ -385,7 +385,8 @@
 					'surplus': row.mtrResidue,
 					'date': row.exprTime,
 					'barrelCode': row.barrelCode,
-					'equId': row.equId
+					'equId': row.equId,
+					'replaceMaterial': row.mtrId
 				}
 				console.log(this.form)
 				this.$refs.editDialog.open()
@@ -400,6 +401,7 @@
 					});
 				}				
 				//console.log(this.form)
+				this.equMaterials.unshift({id:'', mtName: '请选择'});
 			},
 			editClose() {
 				this.editShow = false
@@ -446,6 +448,13 @@
 				let page = pages[pages.length - 1].$page.fullPath;
 				let equId = page.split('equId=')[1]
 				equId = equId? equId: ""
+				if(this.form.replaceMaterial==null || this.form.replaceMaterial==""){
+					return uni.showModal({
+						title: '提示',
+						content: '修正物料不能为空',
+						showCancel: false
+					});
+				}				
 				util.request(api.RecordAdd, this.form, "POST", "application/json").then(function(res) {
 					if (res.code === 0) {
 						uni.showToast({
@@ -515,11 +524,22 @@
 
 	.grid-item-box .errMsg {
 		position: absolute;
-		left: 30%;
-		top: 120rpx;
+		left: 28%;
+		top: 180rpx;
+		font-size: 36rpx;
+		width: 80rpx;
+		color: #f0ad4e;
+		z-index: 9999;
+		margin: 0 auto;
+	}
+	
+	.grid-item-box .expMsg {
+		position: absolute;
+		left: 28%;
+		top: 60rpx;
 		font-size: 36rpx;
 		width: 80rpx;
-		color: #ff0000;
+		color: #f0ad4e;
 		z-index: 9999;
 		margin: 0 auto;
 	}

+ 6 - 3
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/ucenter/order/order.vue

@@ -1,11 +1,11 @@
 <template>
 	<view class="container">
 
-		<picker @change="bindPickerChange" v-model="index" :range="array">
+		<picker @change="bindPickerChange" v-model="index" :range="array" :range-key="'name'">
 			<view class="picker">
 				<view class="label">状态</view>
 				<view class="fb-type">
-					<view class="type-label">{{array[index]}}</view>
+					<view class="type-label">{{array[index].name}}</view>
 					<image class="type-icon"
 						src="/static/images/icon_select.png">
 					</image>
@@ -98,7 +98,10 @@
 				}],
 				orderCount: 2,
 				orderSum: 0.0,
-				array: ['全部', '开门', '关门'],
+				array: [{
+					id: '',
+					name: '全部'
+				},{id:1, name: '已支付'},{id:2, name:'生产中'},{id:3, name:'生产完成'}],
 				orderList: [
 					/*{
 					name: '美式咖啡',

+ 4 - 3
imcs-bt-fe/imcs-bt-fe/uni-mall/utils/util.js

@@ -1,8 +1,8 @@
 const utils = {
 	// 域名
 	//domain: 'https://fly2you.cn/',
-	//domain: 'https://gn.baotingsmart.com/',
-	domain: 'http://127.0.0.1:8764/',
+	domain: 'https://gn.baotingsmart.com/',
+	//domain: 'http://127.0.0.1:8764/',
 	//接口地址
 	interfaceUrl: function(params) {
 		//return utils.domain + 'platform/api/'
@@ -448,7 +448,8 @@ const utils = {
 	},
 	loginH5: function(data){
 		data.interfaceUrl = "/"
-		return utils.request("anno/token", data, "post", "application/json");
+		return utils.request("api/oauth/anno/token", data, "post", "application/json");
+	    //return utils.request("anno/token", data, "post", "application/json");
 	},
 	randomNum: function(len, radix) {
 	  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')