Quellcode durchsuchen

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

# Conflicts:
#	sp-server/app.pid
lzm vor 3 Jahren
Ursprung
Commit
d3c98812ac

+ 4 - 1
app/apis/api.js

@@ -117,5 +117,8 @@ export default {
 	},
 	addDeclare(data){
 		return ajax.postJson('/api/addDeclare',data)
-	}
+	},
+	addDisinfect(data){
+		return ajax.postJson('/api/addDisinfect',data)
+	},
 }

+ 14 - 0
app/pages.json

@@ -171,6 +171,20 @@
 		
 		},
 		{
+			"path": "pages/disinfect/addDisinfect",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		
+		},
+		{
+			"path": "pages/disinfect/addDisinfectSuccess",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		
+		},
+		{
 			"path": "pages/business-entering/item-select",
 			"style": {
 				"navigationBarTitleText": "选择项目",

+ 11 - 7
app/pages/declare/add.vue

@@ -181,6 +181,8 @@
 		data() {
 			return {
 				form: {
+					declarePeople: '',
+					declarePhone: '',
 					goodsName: '',
 					grossWeight: 0,
 					num: 0,
@@ -212,8 +214,10 @@
 			this.checkStore();
 		},
 		methods: {
-			createModal(){
+			createModal() {
 				return {
+					declarePeople: '',
+					declarePhone: '',
 					goodsName: '',
 					grossWeight: 0,
 					num: 0,
@@ -250,7 +254,7 @@
 			},
 			checkStore() {
 				let store = uni.getStorageSync('declare');
-				if (store&&JSON.stringify(store)!==JSON.stringify(this.createModal())) {
+				if (store && JSON.stringify(store) !== JSON.stringify(this.createModal())) {
 					let that = this;
 					uni.showModal({
 						title: '提示',
@@ -266,23 +270,23 @@
 				}
 			},
 			saveFn() {
-				if(!this.form.declarePeople){
+				if (!this.form.declarePeople) {
 					this.$common.toast('请填写申报人');
 					return;
 				}
-				if(!this.form.declarePhone){
+				if (!this.form.declarePhone) {
 					this.$common.toast('请填写申报电话');
 					return;
 				}
-				if(!this.form.goodsName){
+				if (!this.form.goodsName) {
 					this.$common.toast('请填写产品');
 					return;
 				}
-				if(!this.form.productionCode){
+				if (!this.form.productionCode) {
 					this.$common.toast('请填写生产批号');
 					return;
 				}
-				if(!this.form.grossWeight||this.form.grossWeight<=0){
+				if (!this.form.grossWeight || this.form.grossWeight <= 0) {
 					this.$common.toast('请填写毛重');
 					return;
 				}

+ 290 - 0
app/pages/disinfect/addDisinfect.vue

@@ -0,0 +1,290 @@
+<template>
+	<view>
+		<view class="box">
+			<view class="top">
+				<text class="title">申报单录入</text>
+			</view>
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>申报人:</view>
+				<view class="r">
+					<u-input placeholder="申报人" @input="handler()" v-model="form.declarePeople">
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>申报电话:</view>
+				<view class="r">
+					<u-input placeholder="申报电话" @input="handler()" v-model="form.declarePhone">
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">申报单位:</view>
+				<view class="r">
+					<u-input placeholder="申报单位" @input="handler()" v-model="form.applyUnit">
+					</u-input>
+				</view>
+			</view>
+
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>品名:</view>
+				<view class="r">
+					<u-input placeholder="输入品名" @input="handler()" v-model="form.goodsName">
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>重量:</view>
+				<view class="r">
+					<u-input type="number" placeholder="输入毛重" @input="handler()" v-model="form.grossWeight">
+						<text slot="suffix">吨</text>
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">数量:</view>
+				<view class="r">
+					<u-input type="number" placeholder="输入数量" @input="handler()" v-model="form.num">
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">产地:</view>
+				<view class="r">
+					<u-input placeholder="输入产地" @input="handler()" v-model="form.origin">
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">发货人名称:</view>
+				<view class="r">
+					<u-input placeholder="发货人名称" @input="handler()" v-model="form.sendPeople">
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">收货人名称:</view>
+				<view class="r">
+					<u-input placeholder="收货人名称" @input="handler()" v-model="form.receivePeople">
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">规格:</view>
+				<view class="r">
+					<u-input type="number" placeholder="输入规格" @input="handler()" v-model="form.unit">
+						<text slot="suffix">米</text>
+					</u-input>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">包装:</view>
+				<view class="r">
+					<view class="r">
+						<u-input placeholder="输入包装" @input="handler()" v-model="form.pack" />
+					</view>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">标记:</view>
+				<view class="r">
+					<u-input placeholder="标记" @input="handler()" v-model="form.flag" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">号码:</view>
+				<view class="r">
+					<u-input placeholder="号码" @input="handler()" v-model="form.phone" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">启运地:</view>
+				<view class="r">
+					<u-input placeholder="启运地" @input="handler()" v-model="form.sourceAddress" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">到货口岸:</view>
+				<view class="r">
+					<u-input placeholder="到货口岸" @input="handler()" v-model="form.arrivePart" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">运输工具:</view>
+				<view class="r">
+					<u-input placeholder="运输工具" @input="handler()" v-model="form.carName" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">工具号码:</view>
+				<view class="r">
+					<u-input placeholder="运输工具号码" @input="handler()" v-model="form.carNo" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">国内运输工具:</view>
+				<view class="r">
+					<u-input placeholder="国内运输工具" @input="handler()" v-model="form.chinaCarName" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">工具号码:</view>
+				<view class="r">
+					<u-input placeholder="工具号码" @input="handler()" v-model="form.chinaCarNo" />
+				</view>
+			</view>
+			<view class="item">
+				<view class="l" style="flex: 6;">其他要求:</view>
+				<view class="r">
+					<u--textarea @input="handler()" v-model="form.remark" placeholder="其他要求及备注">
+					</u--textarea>
+				</view>
+			</view>
+		</view>
+		<u-button type="primary" text="确定" @click="saveFn"></u-button>
+		<u-button type="info" text="重置" @click="cleanFn" style="margin-top: 20rpx;"></u-button>
+		<!-- ---------------------------------------------------------- -->
+		<view class="bottom-safety"></view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				form: {
+					declarePeople: '',
+					declarePhone: '',
+					goodsName: '',
+					grossWeight: 0,
+					num: 0,
+					origin: '',
+					unit: '',
+					pack: '',
+					flag: '',
+					phone: '',
+					sourceAddress: '',
+					arrivePart: '',
+					carName: '',
+					carNo: '',
+					chinaCarName: '',
+					chinaCarNo: '',
+					remark: ''
+				},
+			}
+		},
+		onShow() {},
+
+		mounted() {
+			this.checkStore();
+		},
+		methods: {
+			createModal() {
+				return {
+					declarePeople: '',
+					declarePhone: '',
+					goodsName: '',
+					grossWeight: 0,
+					num: 0,
+					origin: '',
+					unit: '',
+					pack: '',
+					flag: '',
+					phone: '',
+					sourceAddress: '',
+					arrivePart: '',
+					carName: '',
+					carNo: '',
+					chinaCarName: '',
+					chinaCarNo: '',
+					remark: ''
+				}
+			},
+			cleanFn() {
+				this.form = this.createModal();
+				this.cleanStore();
+			},
+			cleanStore() {
+				uni.removeStorageSync('declare')
+			},
+			handler() {
+				uni.setStorageSync('declare', this.form);
+			},
+			checkStore() {
+				let store = uni.getStorageSync('declare');
+				if (store && JSON.stringify(store) !== JSON.stringify(this.createModal())) {
+					let that = this;
+					uni.showModal({
+						title: '提示',
+						content: '检测到您有未完成表单,是否继续?',
+						success(resp) {
+							if (resp.confirm) {
+								that.form = store
+							} else {
+								that.cleanFn();
+							}
+						}
+					})
+				}
+			},
+			saveFn() {
+				if (!this.form.declarePeople) {
+					this.$common.toast('请填写申报人');
+					return;
+				}
+				if (!this.form.declarePhone) {
+					this.$common.toast('请填写申报电话');
+					return;
+				}
+				if (!this.form.grossWeight || this.form.grossWeight <= 0) {
+					this.$common.toast('请填写重量');
+					return;
+				}
+				this.$api.addDisinfect(this.$common.removeNull(this.form)).then(resp => {
+					this.cleanStore();
+					this.$common.to('/pages/disinfect/addDisinfectSuccess')
+				})
+			}
+		},
+
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.hs-item {
+		text-align: center;
+	}
+
+	.item-line {
+		color: #a2a2a2;
+		padding: 5px 0 10px 29px;
+		border-bottom: 1px solid #E5E5E5;
+	}
+
+	.hj {
+		padding: 50rpx;
+		font-size: 40rpx;
+		color: red;
+		font-weight: bold;
+	}
+
+	.save-btn {
+		background-color: #ff4200;
+		height: 88rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin: 60rpx;
+		color: #fff;
+		font-size: 30rpx;
+		font-weight: bold;
+		border-radius: 10rpx;
+	}
+
+	@import '@/common/common.scss'
+</style>

+ 62 - 0
app/pages/disinfect/addDisinfectSuccess.vue

@@ -0,0 +1,62 @@
+<template>
+	<view class="box">
+		<u-icon name="checkmark-circle-fill" color="#07c160" size="200"></u-icon>
+		<text class="text">消毒申报信息提交成功!</text>
+		<view class="count-down-box">
+			<text @click="goback">返回</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				timestamp: 3,
+			}
+		},
+		onBackPress() {
+			this.goback();
+			return true;
+		},
+		methods: {
+			goback() {
+				this.$common.to('/pages/disinfect/addDisinfect');
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.box {
+		display: flex;
+		flex: 1;
+		align-items: center;
+		justify-content: center;
+		flex-direction: column;
+		padding: 100rpx 0;
+
+		.text {
+			color: #191919;
+			font-size: 36rpx;
+			font-weight: bold;
+			margin-top: 40rpx;
+		}
+
+		.count-down-box {
+			display: flex;
+			flex: 1;
+			align-items: center;
+			justify-content: center;
+			margin-top: 30rpx;
+
+			text {
+				margin-left: 20rpx;
+			}
+		}
+	}
+</style>

BIN
app/static/qrcode.png


+ 2 - 2
app/utils/request.js

@@ -1,6 +1,6 @@
-const server = 'http://127.0.0.1:8099/pro';
+// const server = 'http://127.0.0.1:8099/pro';
 // const server = 'http://47.101.143.145/pro';
- // const server = 'https://dxkaa1.bgigc.com/pro';
+ const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';
 

+ 2 - 0
sp-server/app.pid

@@ -0,0 +1,2 @@
+
+18980

+ 7 - 0
sp-server/src/main/java/com/pj/api/h5/ApiController.java

@@ -13,6 +13,8 @@ import com.pj.project.tb_business_car.TbBusinessCarService;
 import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project.tb_declare.TbDeclare;
+import com.pj.project.tb_disinfect.TbDisinfect;
+import com.pj.project.tb_district.TbDistrict;
 import com.pj.project4sp.admin4login.SpAccAdminService;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.sg.NbUtil;
@@ -110,5 +112,10 @@ public class ApiController {
         apiService.addDeclare(tbDeclare);
         return AjaxJson.getSuccess();
     }
+    @PostMapping(value = "addDisinfect")
+    public AjaxJson addDisinfect(@RequestBody TbDisinfect tbDisinfect){
+        apiService.addDisinfect(tbDisinfect);
+        return AjaxJson.getSuccess();
+    }
 
 }

+ 13 - 0
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -12,6 +12,10 @@ import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project.tb_declare.TbDeclare;
 import com.pj.project.tb_declare.TbDeclareService;
+import com.pj.project.tb_disinfect.TbDisinfect;
+import com.pj.project.tb_disinfect.TbDisinfectService;
+import com.pj.project.tb_district.TbDistrict;
+import com.pj.project.tb_district.TbDistrictService;
 import com.pj.project.tb_pass_record.TbPassRecord;
 import com.pj.project.tb_pass_record.TbPassRecordService;
 import com.pj.utils.cache.RedisUtil;
@@ -48,6 +52,9 @@ public class ApiService {
     TbBusinessCarService tbBusinessCarService;
     @Resource
     private TbDeclareService tbDeclareService;
+    @Resource
+    @Lazy
+    private TbDisinfectService tbDisinfectService;
 
     public List<InOutRecordBO> getInOutRecord(SoMap so) {
         List<TbPassRecord> passRecords = tbPassRecordService.getList(so);
@@ -122,4 +129,10 @@ public class ApiService {
         tbDeclare.setCreateTime(new Date()).setDeclareNo(nowStr + RandomUtil.randomNumbers(6));
         tbDeclareService.save(tbDeclare);
     }
+
+    public void addDisinfect(TbDisinfect tbDisinfect) {
+        String nowStr = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
+        tbDisinfect.setCode(nowStr+RandomUtil.randomNumbers(6)).setApplyTime(new Date());
+        tbDisinfectService.save(tbDisinfect);
+    }
 }

+ 3 - 2
sp-server/src/main/java/com/pj/project/tb_disinfect/TbDisinfect.java

@@ -136,12 +136,12 @@ public class TbDisinfect extends Model<TbDisinfect> implements Serializable {
 	/**
 	 * 申请人 
 	 */
-	private String applyPeople;	
+	private String declarePeople;
 
 	/**
 	 * 申请人联系号码 
 	 */
-	private String applyPhone;	
+	private String declarePhone;
 
 	/**
 	 * 申请时间 
@@ -162,6 +162,7 @@ public class TbDisinfect extends Model<TbDisinfect> implements Serializable {
 	 * 计费(分) 
 	 */
 	private BigDecimal money;
+	private String code;
 
 
 

+ 4 - 4
sp-server/src/main/java/com/pj/project/tb_disinfect/TbDisinfectController.java

@@ -41,8 +41,8 @@ public class TbDisinfectController {
 	@RequestMapping("delete")
 	@SaCheckPermission(TbDisinfect.PERMISSION_CODE)
 	public AjaxJson delete(Long id){
-		int line = tbDisinfectService.delete(id);
-		return AjaxJson.getByLine(line);
+		tbDisinfectService.delete(id);
+		return AjaxJson.getSuccess();
 	}
 	
 	/** 删 - 根据id列表 */  
@@ -58,8 +58,8 @@ public class TbDisinfectController {
 	@RequestMapping("update")
 	@SaCheckPermission(TbDisinfect.PERMISSION_CODE)
 	public AjaxJson update(TbDisinfect t){
-		int line = tbDisinfectService.update(t);
-		return AjaxJson.getByLine(line);
+		tbDisinfectService.update(t);
+		return AjaxJson.getSuccess();
 	}
 
 	/** 查 - 根据id */  

+ 0 - 26
sp-server/src/main/java/com/pj/project/tb_disinfect/TbDisinfectMapper.java

@@ -17,33 +17,7 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface TbDisinfectMapper extends BaseMapper <TbDisinfect> {
 
-	/**
-	 * 增  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int add(TbDisinfect t);
-
-	/**
-	 * 删  
-	 * @param id 要删除的数据id  
-	 * @return 受影响行数 
-	 */
-	int delete(Long id);	 
-
-	/** 
-	 * 改  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int update(TbDisinfect t);
 
-	/** 
-	 * 查 - 根据id  
-	 * @param id 要查询的数据id 
-	 * @return 实体对象 
-	 */
-	TbDisinfect getById(Long id);	 
 
 	/**
 	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)

+ 3 - 52
sp-server/src/main/java/com/pj/project/tb_disinfect/TbDisinfectMapper.xml

@@ -2,49 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.pj.project.tb_disinfect.TbDisinfectMapper">
 
-	<!-- 增 [G] -->
-	<insert id="add">
-		insert into 
-		tb_disinfect (id, send_people, receive_people, goods_name, origin, num, gross_weight, unit, pack, flag, phone, source_address, arrive_part, car_name, car_no, china_car_name, china_car_no, remark, apply_unit, apply_people, apply_phone, apply_time, accept_people, accept_time, money) 
-		values (#{id}, #{sendPeople}, #{receivePeople}, #{goodsName}, #{origin}, #{num}, #{grossWeight}, #{unit}, #{pack}, #{flag}, #{phone}, #{sourceAddress}, #{arrivePart}, #{carName}, #{carNo}, #{chinaCarName}, #{chinaCarNo}, #{remark}, #{applyUnit}, #{applyPeople}, #{applyPhone}, #{applyTime}, #{acceptPeople}, #{acceptTime}, #{money}) 
-	</insert>
-
-	<!-- 删 -->
-	<delete id="delete">
-		delete from tb_disinfect 
-		where id = #{id}
-	</delete>
-
-	<!-- 改 [G] -->
-	<update id="update">
-		update tb_disinfect set
-		id = #{id}, 
-		send_people = #{sendPeople}, 
-		receive_people = #{receivePeople}, 
-		goods_name = #{goodsName}, 
-		origin = #{origin}, 
-		num = #{num}, 
-		gross_weight = #{grossWeight}, 
-		unit = #{unit}, 
-		pack = #{pack}, 
-		flag = #{flag}, 
-		phone = #{phone}, 
-		source_address = #{sourceAddress}, 
-		arrive_part = #{arrivePart}, 
-		car_name = #{carName}, 
-		car_no = #{carNo}, 
-		china_car_name = #{chinaCarName}, 
-		china_car_no = #{chinaCarNo}, 
-		remark = #{remark}, 
-		apply_unit = #{applyUnit}, 
-		apply_people = #{applyPeople}, 
-		apply_phone = #{applyPhone}, 
-		apply_time = #{applyTime}, 
-		accept_people = #{acceptPeople}, 
-		accept_time = #{acceptTime}, 
-		money = #{money}
-		where id = #{id}
-	</update>
 
 
 	<!-- ================================== 查询相关 ================================== -->
@@ -71,8 +28,8 @@
 		<result property="chinaCarNo" column="china_car_no" />
 		<result property="remark" column="remark" />
 		<result property="applyUnit" column="apply_unit" />
-		<result property="applyPeople" column="apply_people" />
-		<result property="applyPhone" column="apply_phone" />
+		<result property="declarePeople" column="apply_people" />
+		<result property="declarePhone" column="apply_phone" />
 		<result property="applyTime" column="apply_time" />
 		<result property="acceptPeople" column="accept_people" />
 		<result property="acceptTime" column="accept_time" />
@@ -84,13 +41,7 @@
 		select * 
 		from tb_disinfect 
 	</sql>
-	
-	<!-- 查 - 根据id -->
-	<select id="getById" resultMap="model">
-		<include refid="select_sql"></include>
-		where id = #{id}
-	</select>
-	
+
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>

+ 7 - 7
sp-server/src/main/java/com/pj/project/tb_disinfect/TbDisinfectService.java

@@ -24,23 +24,23 @@ public class TbDisinfectService extends ServiceImpl<TbDisinfectMapper, TbDisinfe
 	TbDisinfectMapper tbDisinfectMapper;
 
 	/** 增 */
-	int add(TbDisinfect t){
-		return tbDisinfectMapper.add(t);
+	void add(TbDisinfect t){
+		this.save(t);
 	}
 
 	/** 删 */
-	int delete(Long id){
-		return tbDisinfectMapper.delete(id);
+	void delete(Long id){
+		this.removeById(id);
 	}
 
 	/** 改 */
-	int update(TbDisinfect t){
-		return tbDisinfectMapper.update(t);
+	void update(TbDisinfect t){
+		this.updateById(t);
 	}
 
 	/** 查 */
 	TbDisinfect getById(Long id){
-		return tbDisinfectMapper.getById(id);
+		return super.getById(id);
 	}
 
 	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */