Browse Source

[CODE]: 驾驶员模块

maxianghua 4 years ago
parent
commit
005ba2ae21

+ 5 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fleet/compayMsg/FleetDriverMsgController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.web.controller.fleet.compayMsg;
 
 import java.util.List;
+import java.util.Map;
 
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.utils.SecurityUtils;
@@ -56,7 +57,8 @@ public class FleetDriverMsgController extends BaseController
     public TableDataInfo qurey(FleetDriverMsg fleetDriverMsg)
     {
         startPage();
-        List<FleetDriverMsg> list = fleetDriverMsgService.selectFleetDriverMsgList(fleetDriverMsg);
+        // List<FleetDriverMsg> list = fleetDriverMsgService.selectFleetDriverMsgList(fleetDriverMsg);
+        List<Map<String, Object>> list = fleetDriverMsgService.selectFleetDriverMsgListMap(fleetDriverMsg);
         return getDataTable(list);
     }
 
@@ -91,10 +93,10 @@ public class FleetDriverMsgController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody FleetDriverMsg fleetDriverMsg)
     {
-        if(fleetDriverMsg.getId()==null && fleetDriverMsg.getId().equals("")){
+        if(fleetDriverMsg.getId()==null ||  fleetDriverMsg.getId().equals("")){
             //检验登录名  唯一
             if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(fleetDriverMsg.getTel()))) {
-                return AjaxResult.error("新增用户'" + fleetDriverMsg.getTel() + "'失败,登录账号已存在");
+                return AjaxResult.error("新增驾驶员'" + fleetDriverMsg.getName() + "'失败,登录账号(联系电话)已存在()");
             }
         }
         return fleetDriverMsgService.insertFleetDriverMsg(fleetDriverMsg);

+ 2 - 1
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/mapper/FleetDriverMsgMapper.java

@@ -1,6 +1,7 @@
 package com.ruoyi.orderManagement.mapper;
 
 import java.util.List;
+import java.util.Map;
 
 import com.ruoyi.orderManagement.domain.FleetDriverMsg;
 
@@ -28,7 +29,7 @@ public interface FleetDriverMsgMapper
      * @return 【司机】集合
      */
     public List<FleetDriverMsg> selectFleetDriverMsgList(FleetDriverMsg fleetDriverMsg);
-
+    public List<Map<String, Object>>  selectFleetDriverMsgListMap(FleetDriverMsg fleetDriverMsg);
     /**
      * 新增【司机】
      * 

+ 2 - 1
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/service/IFleetDriverMsgService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.orderManagement.service;
 
 import java.util.List;
+import java.util.Map;
 
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.orderManagement.domain.FleetDriverMsg;
@@ -28,7 +29,7 @@ public interface IFleetDriverMsgService
      * @return 【司机】集合
      */
     public List<FleetDriverMsg> selectFleetDriverMsgList(FleetDriverMsg fleetDriverMsg);
-
+    public List<Map<String, Object>> selectFleetDriverMsgListMap(FleetDriverMsg fleetDriverMsg);
     /**
      * 新增【司机】
      * 

+ 5 - 7
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/service/impl/FleetCarManageServiceImpl.java

@@ -159,13 +159,11 @@ public class FleetCarManageServiceImpl implements IFleetCarManageService
             JSONArray jsonDrArray = JSONArray.parseArray(fTmsorderbillsattachs);
             List<Ftmsorderbillsattachs> ftmsorderbillsattachsList = JSONObject.parseArray(jsonDrArray.toJSONString(), Ftmsorderbillsattachs.class);
             for (Ftmsorderbillsattachs ftmsorderbillsattachs : ftmsorderbillsattachsList) {
-                if(null!=ftmsorderbillsattachs.getActId() && !ftmsorderbillsattachs.getActId().equals("")){
-                    ftmsorderbillsattachs.setPId(fPid);
-                    ftmsorderbillsattachs.setOrgId(fPid);
-                    ftmsorderbillsattachs.setCreateBy(SecurityUtils.getUsername());
-                    ftmsorderbillsattachs.setCreateTime(new Date());
-                    ftmsorderbillsattachsMapper.insertftmsorderbillsattachs(ftmsorderbillsattachs);
-                }
+                ftmsorderbillsattachs.setPId(fPid);
+                ftmsorderbillsattachs.setOrgId(fPid);
+                ftmsorderbillsattachs.setCreateBy(SecurityUtils.getUsername());
+                ftmsorderbillsattachs.setCreateTime(new Date());
+                ftmsorderbillsattachsMapper.insertftmsorderbillsattachs(ftmsorderbillsattachs);
             }
         }
         map.put("fleetCarManage", fleetCarManage1);

+ 7 - 1
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/service/impl/FleetDriverMsgServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.orderManagement.service.impl;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -68,6 +69,11 @@ public class FleetDriverMsgServiceImpl implements IFleetDriverMsgService
         return fleetDriverMsgMapper.selectFleetDriverMsgList(fleetDriverMsg);
     }
 
+    @Override
+    public List<Map<String, Object>> selectFleetDriverMsgListMap(FleetDriverMsg fleetDriverMsg) {
+        return fleetDriverMsgMapper.selectFleetDriverMsgListMap(fleetDriverMsg);
+    }
+
     /**
      * 新增【司机】
      * 
@@ -98,7 +104,7 @@ public class FleetDriverMsgServiceImpl implements IFleetDriverMsgService
             sysUser.setNickName(fleetDriverMsg.getName());
             sysUser.setPhonenumber(fleetDriverMsg.getTel());
             //sysUser.setEmail(fleetDriverMsg.get);
-            sysUser.setPassword(fleetDriverMsg.getTel());
+            sysUser.setPassword(SecurityUtils.encryptPassword(fleetDriverMsg.getTel()));
             sysUser.setDeptId(120L); // 当前给定、后期修改
             Long [] rolr = {110L}; // 当前给定、后期修改
             sysUser.setRoleIds(rolr);

+ 43 - 1
ruoyi-fleet/src/main/resources/mapper/FleetDriverMsgMapper.xml

@@ -139,5 +139,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
-    
+    <select id="selectFleetDriverMsgListMap" parameterType="FleetDriverMsg" resultType="Map">
+        SELECT
+            dri.id AS id,
+            com.company_name AS companyName,
+            dri.`name` AS `name`,
+            dri.sex AS sex,
+            dri.birthday AS birthday,
+            dri.allow_driver_car AS allowDriverCar,
+            dri.first_certificate_date AS firstCertificateDate,
+            dri.idcar_num AS idcarNum,
+            dri.tel AS tel,
+            dri.address AS address,
+            dri.resume_pic AS resumePic,
+            dri.driving_pic AS drivingPic,
+            dri.creat_time AS creatTime,
+            dri.modification_time AS modificationTime,
+            dri.bill_status AS billStatus,
+            dri.del_flag,
+            dri.create_by,
+            dri.update_by,
+            dri.update_time,
+            dri.remarks AS remarks
+        FROM
+            fleet_driver_msg dri
+        LEFT JOIN fleet_company_msg AS com ON dri.fleet_company_id = com.id
+        <where>
+            <if test="fleetCompanyId != null "> and dri.fleet_company_id = #{fleetCompanyId}</if>
+            <if test="name != null  and name != ''"> and dri.name like concat('%', #{name}, '%')</if>
+            <if test="sex != null "> and dri.sex = #{sex}</if>
+            <if test="birthday != null "> and dri.birthday = #{birthday}</if>
+            <if test="allowDriverCar != null  and allowDriverCar != ''"> and dri.allow_driver_car = #{allowDriverCar}</if>
+            <if test="firstCertificateDate != null "> and dri.first_certificate_date = #{firstCertificateDate}</if>
+            <if test="idcarNum != null  and idcarNum != ''"> and dri.idcar_num = #{idcarNum}</if>
+            <if test="tel != null  and tel != ''"> and dri.tel = #{tel}</if>
+            <if test="address != null  and address != ''"> and dri.address = #{address}</if>
+            <if test="resumePic != null  and resumePic != ''"> and dri.resume_pic = #{resumePic}</if>
+            <if test="drivingPic != null  and drivingPic != ''"> and dri.driving_pic = #{drivingPic}</if>
+            <if test="creatTime != null "> and dri.creat_time = #{creatTime}</if>
+            <if test="modificationTime != null "> and dri.modification_time = #{modificationTime}</if>
+            <if test="billStatus != null "> and dri.bill_status = #{billStatus}</if>
+            <if test="remarks != null  and remarks != ''"> and dri.remarks = #{remarks}</if>
+        </where>
+    </select>
 </mapper>

+ 1 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/mapper/TFeeMapper.java

@@ -75,6 +75,7 @@ public interface TFeeMapper {
 
     public List<Map<String, Object>> warehouseBillsFeesList1(TWareHouseFees tWareHouseFees);
 
+    public List<Map<String, Object>> warehouseBillsFeesProfitList(TWareHouseFees tWareHouseFees);
 
     /**
      * 查询详情主表列表

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -341,6 +341,11 @@ public class TFeeServiceImpl implements ITFeeService {
         return tFeeMapper.warehouseBillsFeesList1(tWareHouseFees);
     }
 
+    @Override
+    public List<Map<String, Object>> warehouseBillsFeesProfitList(TWareHouseFees tWareHouseFees) {
+        return tFeeMapper.warehouseBillsFeesProfitList(tWareHouseFees);
+    }
+
     public static BigDecimal calculation1(String fTotalgross, String fGrossweightblc) {
         BigDecimal num1 = new BigDecimal(fTotalgross);
         BigDecimal num2 = new BigDecimal(fGrossweightblc);