Commit 64bfc273920a3afcdde1c5ee1484642a0b582871
1 parent
4ea8b8de
运输公司新增公司头像logo字段
Showing
6 changed files
with
118 additions
and
5 deletions
trash-ui/src/views/unit/enterprise/info.vue
| ... | ... | @@ -321,6 +321,39 @@ |
| 321 | 321 | </div> |
| 322 | 322 | </el-col> |
| 323 | 323 | </el-row> |
| 324 | + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;"> | |
| 325 | + <el-col :span="3"> | |
| 326 | + <div class="upload_lable"> | |
| 327 | + 公司头像或LOGO | |
| 328 | + <el-upload | |
| 329 | + ref="upload" | |
| 330 | + action="" | |
| 331 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg" | |
| 332 | + :on-change="fileChange5" | |
| 333 | + :auto-upload="false" | |
| 334 | + :show-file-list="false" | |
| 335 | + multiple | |
| 336 | + :file-list="companyLogo"> | |
| 337 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 338 | + </el-upload> | |
| 339 | + </div> | |
| 340 | + </el-col> | |
| 341 | + <el-col :span="21"> | |
| 342 | + <div class="upload_btn"> | |
| 343 | + <div v-for="(item,index) in companyLogo"> | |
| 344 | + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image"> | |
| 345 | + <div class="upload_close" @click="companyLogo.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 346 | + <el-image | |
| 347 | + style="width: 110px; height: 95px; margin: 5px;float:left;" | |
| 348 | + :src="createUrl(item)" | |
| 349 | + :preview-src-list="[createUrl(item)]" | |
| 350 | + :z-index="999"> | |
| 351 | + </el-image> | |
| 352 | + </div> | |
| 353 | + </div> | |
| 354 | + </div> | |
| 355 | + </el-col> | |
| 356 | + </el-row> | |
| 324 | 357 | <!-- <el-form-item label="" prop="environmentalApproval">--> |
| 325 | 358 | <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />--> |
| 326 | 359 | <!-- </el-form-item>--> |
| ... | ... | @@ -490,6 +523,8 @@ export default { |
| 490 | 523 | safetyCertificate:[], |
| 491 | 524 | // 停车场全景图 |
| 492 | 525 | carParkPanorama:[], |
| 526 | + //公司logo,公司头像 | |
| 527 | + companyLogo:[], | |
| 493 | 528 | enterpriseList:[], |
| 494 | 529 | // 地图 |
| 495 | 530 | map: null, |
| ... | ... | @@ -607,6 +642,7 @@ export default { |
| 607 | 642 | this.safetyOfficerQualificationCertificate = []; |
| 608 | 643 | this.safetyCertificate = []; |
| 609 | 644 | this.carParkPanorama = []; |
| 645 | + this.companyLogo = []; | |
| 610 | 646 | }, |
| 611 | 647 | initData(){ |
| 612 | 648 | this.reset(); |
| ... | ... | @@ -650,6 +686,13 @@ export default { |
| 650 | 686 | this.carParkPanorama.push({name:name,url:item}) |
| 651 | 687 | }) |
| 652 | 688 | } |
| 689 | + if(this.form.companyLogo!=null&&this.form.companyLogo!==""){ | |
| 690 | + let safetyAssessmentReport = this.form.companyLogo.split(";"); | |
| 691 | + safetyAssessmentReport.map(item=>{ | |
| 692 | + let name = item.substring(item.lastIndexOf("/")+1); | |
| 693 | + this.companyLogo.push({name:name,url:item}) | |
| 694 | + }) | |
| 695 | + } | |
| 653 | 696 | }); |
| 654 | 697 | } |
| 655 | 698 | }, |
| ... | ... | @@ -705,6 +748,7 @@ export default { |
| 705 | 748 | form.safetyOfficerQualificationCertificate = null; |
| 706 | 749 | form.safetyCertificate = null; |
| 707 | 750 | form.carParkPanorama = null; |
| 751 | + form.companyLogo = null; | |
| 708 | 752 | form.companyType = "1"; |
| 709 | 753 | |
| 710 | 754 | this.transportPermission.forEach(item => { |
| ... | ... | @@ -748,6 +792,14 @@ export default { |
| 748 | 792 | form.carParkPanorama = form.carParkPanorama!==null?form.carParkPanorama+";"+item.url:item.url; |
| 749 | 793 | } |
| 750 | 794 | }) |
| 795 | + this.companyLogo.forEach(item => { | |
| 796 | + if (item.raw != null) { | |
| 797 | + formData.append('companyLogoFiles', item.raw) | |
| 798 | + }else{ | |
| 799 | + //将原有的附件拼接到form中 | |
| 800 | + form.companyLogo = form.companyLogo!==null?form.companyLogo+";"+item.url:item.url; | |
| 801 | + } | |
| 802 | + }) | |
| 751 | 803 | for (let key in form) { |
| 752 | 804 | formData.append(key, form[key] == null ? "" : form[key]) |
| 753 | 805 | } |
| ... | ... | @@ -999,6 +1051,36 @@ export default { |
| 999 | 1051 | fileList = fileList.splice(fileList.length - 1, 1); |
| 1000 | 1052 | } |
| 1001 | 1053 | }, |
| 1054 | + fileChange5(file, fileList) { | |
| 1055 | + if(fileList.length>1){ | |
| 1056 | + this.$message({ | |
| 1057 | + message: '只能上传一张图片!', | |
| 1058 | + type: 'warning' | |
| 1059 | + }); | |
| 1060 | + return false; | |
| 1061 | + } | |
| 1062 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 1063 | + //格式符合后判断大小 | |
| 1064 | + if ("jpg,jpeg,png,gif,jfif,pjpeg".indexOf(fileType) != -1) { | |
| 1065 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 1066 | + if (!max5M) { | |
| 1067 | + this.$message({ | |
| 1068 | + message: '上传文件大小不得超过100M!', | |
| 1069 | + type: 'warning' | |
| 1070 | + }); | |
| 1071 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 1072 | + } else { | |
| 1073 | + //符合条件后进行添加 | |
| 1074 | + this.companyLogo = fileList | |
| 1075 | + } | |
| 1076 | + } else { | |
| 1077 | + this.$message({ | |
| 1078 | + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg格式!', | |
| 1079 | + type: 'warning' | |
| 1080 | + }); | |
| 1081 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 1082 | + } | |
| 1083 | + }, | |
| 1002 | 1084 | } |
| 1003 | 1085 | }; |
| 1004 | 1086 | </script> | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/controller/TransportationEnterpriseController.java
| ... | ... | @@ -74,8 +74,9 @@ public class TransportationEnterpriseController extends BaseController |
| 74 | 74 | @RequestParam(value = "safetyOfficerQualificationCertificateFiles") MultipartFile[] safetyOfficerQualificationCertificateFiles, |
| 75 | 75 | @RequestParam(value = "safetyCertificateFiles") MultipartFile[] safetyCertificateFiles, |
| 76 | 76 | @RequestParam(value = "carParkPanoramaFiles") MultipartFile[] carParkPanoramaFiles, |
| 77 | + @RequestParam(value = "companyLogoFiles") MultipartFile[] companyLogoFiles, | |
| 77 | 78 | TransportationEnterprise transportationEnterprise) throws IOException { |
| 78 | - return toAjax(transportationEnterpriseService.insertTransportationEnterprise(transportPermissionFiles, enterpriseBusinessLicenseFiles, safetyOfficerQualificationCertificateFiles, safetyCertificateFiles, carParkPanoramaFiles, transportationEnterprise)); | |
| 79 | + return toAjax(transportationEnterpriseService.insertTransportationEnterprise(transportPermissionFiles, enterpriseBusinessLicenseFiles, safetyOfficerQualificationCertificateFiles, safetyCertificateFiles, carParkPanoramaFiles,companyLogoFiles, transportationEnterprise)); | |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 82 | /** |
| ... | ... | @@ -89,8 +90,9 @@ public class TransportationEnterpriseController extends BaseController |
| 89 | 90 | @RequestParam(value = "safetyOfficerQualificationCertificateFiles") MultipartFile[] safetyOfficerQualificationCertificateFiles, |
| 90 | 91 | @RequestParam(value = "safetyCertificateFiles") MultipartFile[] safetyCertificateFiles, |
| 91 | 92 | @RequestParam(value = "carParkPanoramaFiles") MultipartFile[] carParkPanoramaFiles, |
| 93 | + @RequestParam(value = "companyLogoFiles") MultipartFile[] companyLogoFiles, | |
| 92 | 94 | TransportationEnterprise transportationEnterprise) throws IOException { |
| 93 | - return toAjax(transportationEnterpriseService.updateTransportationEnterprise(transportPermissionFiles, enterpriseBusinessLicenseFiles, safetyOfficerQualificationCertificateFiles, safetyCertificateFiles, carParkPanoramaFiles, transportationEnterprise)); | |
| 95 | + return toAjax(transportationEnterpriseService.updateTransportationEnterprise(transportPermissionFiles, enterpriseBusinessLicenseFiles, safetyOfficerQualificationCertificateFiles, safetyCertificateFiles, carParkPanoramaFiles,companyLogoFiles, transportationEnterprise)); | |
| 94 | 96 | } |
| 95 | 97 | |
| 96 | 98 | /** | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/domain/TransportationEnterprise.java
| ... | ... | @@ -133,6 +133,21 @@ public class TransportationEnterprise extends BaseEntity |
| 133 | 133 | @Excel(name = "公司报价") |
| 134 | 134 | private String offer; |
| 135 | 135 | |
| 136 | + /** | |
| 137 | + * 公司logo,公司头像 | |
| 138 | + */ | |
| 139 | + private String companyLogo; | |
| 140 | + | |
| 141 | + | |
| 142 | + public String getCompanyLogo() { | |
| 143 | + return companyLogo; | |
| 144 | + } | |
| 145 | + | |
| 146 | + | |
| 147 | + public void setCompanyLogo(String companyLogo) { | |
| 148 | + this.companyLogo = companyLogo; | |
| 149 | + } | |
| 150 | + | |
| 136 | 151 | public String getOffer() { |
| 137 | 152 | return offer; |
| 138 | 153 | } | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/service/ITransportationEnterpriseService.java
| ... | ... | @@ -45,6 +45,7 @@ public interface ITransportationEnterpriseService |
| 45 | 45 | MultipartFile[] safetyOfficerQualificationCertificateFiles, |
| 46 | 46 | MultipartFile[] safetyCertificateFiles, |
| 47 | 47 | MultipartFile[] carParkPanoramaFiles, |
| 48 | + MultipartFile[] companyLogoFiles, | |
| 48 | 49 | TransportationEnterprise transportationEnterprise) throws IOException; |
| 49 | 50 | |
| 50 | 51 | /** |
| ... | ... | @@ -63,6 +64,7 @@ public interface ITransportationEnterpriseService |
| 63 | 64 | MultipartFile[] safetyOfficerQualificationCertificateFiles, |
| 64 | 65 | MultipartFile[] safetyCertificateFiles, |
| 65 | 66 | MultipartFile[] carParkPanoramaFiles, |
| 67 | + MultipartFile[] companyLogoFiles, | |
| 66 | 68 | TransportationEnterprise transportationEnterprise) throws IOException; |
| 67 | 69 | |
| 68 | 70 | /** | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/service/impl/TransportationEnterpriseServiceImpl.java
| ... | ... | @@ -63,7 +63,7 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 63 | 63 | * @return 结果 |
| 64 | 64 | */ |
| 65 | 65 | @Override |
| 66 | - public int insertTransportationEnterprise(MultipartFile[] transportPermissionFiles, MultipartFile[] enterpriseBusinessLicenseFiles, MultipartFile[] safetyOfficerQualificationCertificateFiles, MultipartFile[] safetyCertificateFiles, MultipartFile[] carParkPanoramaFiles, TransportationEnterprise transportationEnterprise) throws IOException { | |
| 66 | + public int insertTransportationEnterprise(MultipartFile[] transportPermissionFiles, MultipartFile[] enterpriseBusinessLicenseFiles, MultipartFile[] safetyOfficerQualificationCertificateFiles, MultipartFile[] safetyCertificateFiles, MultipartFile[] carParkPanoramaFiles, MultipartFile[] companyLogoFiles, TransportationEnterprise transportationEnterprise) throws IOException { | |
| 67 | 67 | transportationEnterprise.setCreateTime(DateUtils.getNowDate()); |
| 68 | 68 | transportationEnterprise.setCreateBy(SecurityUtils.getUsername()); |
| 69 | 69 | transportationEnterprise.setStatus(0); |
| ... | ... | @@ -83,12 +83,16 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 83 | 83 | for (MultipartFile file : carParkPanoramaFiles) { |
| 84 | 84 | transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama()!=null?transportationEnterprise.getCarParkPanorama()+";"+upload(file):upload(file)); |
| 85 | 85 | } |
| 86 | + for (MultipartFile file : companyLogoFiles) { | |
| 87 | + transportationEnterprise.setCompanyLogo(transportationEnterprise.getCompanyLogo()!=null?transportationEnterprise.getCompanyLogo()+";"+upload(file):upload(file)); | |
| 88 | + } | |
| 86 | 89 | //去掉第一个分号,如果有的话 |
| 87 | 90 | transportationEnterprise.setTransportPermission(removeSemicolon(transportationEnterprise.getTransportPermission())); |
| 88 | 91 | transportationEnterprise.setEnterpriseBusinessLicense(removeSemicolon(transportationEnterprise.getEnterpriseBusinessLicense())); |
| 89 | 92 | transportationEnterprise.setSafetyOfficerQualificationCertificate(removeSemicolon(transportationEnterprise.getSafetyOfficerQualificationCertificate())); |
| 90 | 93 | transportationEnterprise.setSafetyCertificate(removeSemicolon(transportationEnterprise.getSafetyCertificate())); |
| 91 | 94 | transportationEnterprise.setCarParkPanorama(removeSemicolon(transportationEnterprise.getCarParkPanorama())); |
| 95 | + transportationEnterprise.setCompanyLogo(removeSemicolon(transportationEnterprise.getCompanyLogo())); | |
| 92 | 96 | return transportationEnterpriseMapper.insertTransportationEnterprise(transportationEnterprise); |
| 93 | 97 | } |
| 94 | 98 | |
| ... | ... | @@ -104,7 +108,7 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 104 | 108 | * @return 结果 |
| 105 | 109 | */ |
| 106 | 110 | @Override |
| 107 | - public int updateTransportationEnterprise(MultipartFile[] transportPermissionFiles, MultipartFile[] enterpriseBusinessLicenseFiles, MultipartFile[] safetyOfficerQualificationCertificateFiles, MultipartFile[] safetyCertificateFiles, MultipartFile[] carParkPanoramaFiles, TransportationEnterprise transportationEnterprise) throws IOException { | |
| 111 | + public int updateTransportationEnterprise(MultipartFile[] transportPermissionFiles, MultipartFile[] enterpriseBusinessLicenseFiles, MultipartFile[] safetyOfficerQualificationCertificateFiles, MultipartFile[] safetyCertificateFiles, MultipartFile[] carParkPanoramaFiles, MultipartFile[] companyLogoFiles, TransportationEnterprise transportationEnterprise) throws IOException { | |
| 108 | 112 | transportationEnterprise.setUpdateTime(DateUtils.getNowDate()); |
| 109 | 113 | transportationEnterprise.setUpdateBy(SecurityUtils.getUsername()); |
| 110 | 114 | for (MultipartFile file : transportPermissionFiles) { |
| ... | ... | @@ -122,11 +126,15 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 122 | 126 | for (MultipartFile file : carParkPanoramaFiles) { |
| 123 | 127 | transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama()!=null?transportationEnterprise.getCarParkPanorama()+";"+upload(file):upload(file)); |
| 124 | 128 | } |
| 129 | + for (MultipartFile file : companyLogoFiles) { | |
| 130 | + transportationEnterprise.setCompanyLogo(transportationEnterprise.getCompanyLogo()!=null?transportationEnterprise.getCompanyLogo()+";"+upload(file):upload(file)); | |
| 131 | + } | |
| 125 | 132 | transportationEnterprise.setTransportPermission(removeSemicolon(transportationEnterprise.getTransportPermission())); |
| 126 | 133 | transportationEnterprise.setEnterpriseBusinessLicense(removeSemicolon(transportationEnterprise.getEnterpriseBusinessLicense())); |
| 127 | 134 | transportationEnterprise.setSafetyOfficerQualificationCertificate(removeSemicolon(transportationEnterprise.getSafetyOfficerQualificationCertificate())); |
| 128 | 135 | transportationEnterprise.setSafetyCertificate(removeSemicolon(transportationEnterprise.getSafetyCertificate())); |
| 129 | 136 | transportationEnterprise.setCarParkPanorama(removeSemicolon(transportationEnterprise.getCarParkPanorama())); |
| 137 | + transportationEnterprise.setCompanyLogo(removeSemicolon(transportationEnterprise.getCompanyLogo())); | |
| 130 | 138 | return transportationEnterpriseMapper.updateTransportationEnterprise(transportationEnterprise); |
| 131 | 139 | } |
| 132 | 140 | ... | ... |
trash-unit/src/main/resources/mapper/unit/TransportationEnterpriseMapper.xml
| ... | ... | @@ -41,10 +41,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 41 | 41 | <result property="qrCode" column="qr_code" /> |
| 42 | 42 | <result property="servicePhone" column="service_phone" /> |
| 43 | 43 | <result property="offer" column="offer" /> |
| 44 | + <result property="companyLogo" column="company_logo" /> | |
| 44 | 45 | </resultMap> |
| 45 | 46 | |
| 46 | 47 | <sql id="selectTransportationEnterpriseVo"> |
| 47 | - select id, name, abbreviation, registration_area, transport_permission_date, enter_date, business_license_date, office_address, parking_lot_location, parking_area, (select count(id) from car_info where company_id = te.id) car_number, safety_manager_name, safety_manager_phone, social_uniform_credit_code_number, legal_representative, legal_representative_phone, safety_people_name, remark, transport_permission, enterprise_business_license, safety_officer_qualification_certificate, safety_certificate, car_park_panorama, business_unit, status, create_time, create_by, update_time, update_by, parent_id, company_type, credit_status, qr_code,service_phone,office_address_gps,offer from transportation_enterprise te | |
| 48 | + select id, name, abbreviation, registration_area, transport_permission_date, enter_date, business_license_date, office_address, parking_lot_location, parking_area, (select count(id) from car_info where company_id = te.id) car_number, safety_manager_name, safety_manager_phone, social_uniform_credit_code_number, legal_representative, legal_representative_phone, safety_people_name, remark, transport_permission, enterprise_business_license, safety_officer_qualification_certificate, safety_certificate, car_park_panorama, business_unit, status, create_time, create_by, update_time, update_by, parent_id, company_type, credit_status, qr_code,service_phone,office_address_gps,offer,company_logo from transportation_enterprise te | |
| 48 | 49 | </sql> |
| 49 | 50 | |
| 50 | 51 | <select id="selectTransportationEnterpriseList" parameterType="TransportationEnterprise" resultMap="TransportationEnterpriseResult"> |
| ... | ... | @@ -124,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 124 | 125 | <if test="servicePhone != null">service_phone,</if> |
| 125 | 126 | <if test="officeAddressGps != null">office_address_gps,</if> |
| 126 | 127 | <if test="offer != null">offer,</if> |
| 128 | + <if test="companyLogo != null">company_logo,</if> | |
| 127 | 129 | </trim> |
| 128 | 130 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| 129 | 131 | <if test="name != null">#{name},</if> |
| ... | ... | @@ -161,6 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 161 | 163 | <if test="servicePhone != null">#{servicePhone},</if> |
| 162 | 164 | <if test="officeAddressGps != null">#{officeAddressGps},</if> |
| 163 | 165 | <if test="offer != null">#{offer},</if> |
| 166 | + <if test="companyLogo != null">#{companyLogo},</if> | |
| 164 | 167 | </trim> |
| 165 | 168 | </insert> |
| 166 | 169 | |
| ... | ... | @@ -202,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 202 | 205 | <if test="servicePhone != null">service_phone = #{servicePhone},</if> |
| 203 | 206 | <if test="officeAddressGps != null">office_address_gps = #{officeAddressGps},</if> |
| 204 | 207 | <if test="offer != null">offer = #{offer},</if> |
| 208 | + <if test="companyLogo != null">company_logo = #{companyLogo},</if> | |
| 205 | 209 | </trim> |
| 206 | 210 | where id = #{id} |
| 207 | 211 | </update> | ... | ... |