Commit f954948c by xiehx

合并1.70.0以及之前尚未合并到主干的版本代码到主干

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@35496 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 4e059c2c
Showing 28 changed files with 504 additions and 329 deletions
......@@ -27,6 +27,18 @@
<artifactId>car-service-common</artifactId>
<version>1.0.1</version>
</dependency>
<!--导出工具-->
<dependency>
<groupId>com.glsx.poi</groupId>
<artifactId>glsx-poi-jar</artifactId>
<version>2.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
......@@ -71,6 +83,16 @@
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.1</version>
<exclusions>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
......@@ -83,7 +105,17 @@
<artifactId>ore-jms</artifactId>
<version>2.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
</dependencies>
<build>
......
......@@ -275,4 +275,6 @@ public interface BizConstants {
*/
String VOLVO = "volvo";
String EXCEL_TYPE_XLSX = "xlsx";
}
......@@ -179,6 +179,8 @@ public enum ResultCodeEnum {
INSURANCE_UPDATE_ERROR(4008, "修改保单信息异常"),
INSURANCE_REFUND_STATUS_ERROR(4009, "保单当前状态无法退保"),
INSURANCE_LESS_SEVEN_DAY(4010, "投保不超过七天,请走退保流程"),
CHECK_IMPORT_FILE_ERROR(12120011, "请检查模版字段"),
INDENT_IMPORT_TO_MANY(12120012, "导入数据量大于5000条,请重新导入"),
;
/**
......
package com.glsx.ordercenter.dto.imports;
import lombok.Data;
@Data
public class BaseImportInfo {
/**
* 导入成功数量
*/
private int succNum;
/**
* 导入失败数量
*/
private int failNum;
/**
* 导入总数量
*/
private int total;
/**
* 失败文件服务器地址
*/
private String failFile;
/**
* 失败文件序列号
*/
private String failSeqNoFile;
}
package com.glsx.ordercenter.dto.imports;
import com.alibaba.excel.annotation.ExcelProperty;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.Data;
import java.io.Serializable;
/**
* 设备和订货单错误导出实体类
*/
@Data
public class DeviceAndIndentExport implements Serializable {
@ExcelProperty(value = "SN", index = 0)
private String sn;
@ExcelProperty(value = "设备名称", index = 1)
private String deviceTypeName;
@ExcelProperty(value = "物流公司", index = 2)
private String expressCompany;
@ExcelProperty(value = "物流单号", index = 3)
private String expressSn;
@ExcelProperty(value = "发货时间", index = 4)
private String logisticsTime;
@ExcelProperty(value = "服务商名称", index = 5)
private String providerName;
@ExcelProperty(value = "下属技工名称", index = 6)
private String mechanicName;
@ExcelProperty(value = "失败原因", index = 7)
private String importFailReason;
}
package com.glsx.ordercenter.dto.imports;
import com.alibaba.excel.annotation.ExcelProperty;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 设备和订货单导入实体类
*/
@Data
public class DeviceAndIndentImport implements Serializable {
@ExcelProperty(value = "SN", index = 0)
private String sn;
@ExcelProperty(value = "设备名称", index = 1)
private String deviceTypeName;
@ExcelProperty(value = "物流公司", index = 2)
private String expressCompany;
@ExcelProperty(value = "物流单号", index = 3)
private String expressSn;
@ExcelProperty(value = "发货时间", index = 4)
private String logisticsTime;
@ExcelProperty(value = "服务商名称", index = 5)
private String providerName;
@ExcelProperty(value = "下属技工名称", index = 6)
private String mechanicName;
@Ignore
private String importFailReason;
/**
* 设备类型
*/
@Ignore
private String deviceType;
/**
* 服务商用户ID
*/
@Ignore
private Integer providerUserId;
/**
* 技工用户ID
*/
@Ignore
private Integer mechanicUserId;
/**
* 快递公司编码
*/
@Ignore
private String expressCompanyUnicode;
/**
* 设备号集合
*/
@Ignore
private List<String> snList;
}
package com.glsx.ordercenter.enums;
import lombok.Getter;
/**
* @author Yanglinlong
* @date 2023/8/22 18:10
*/
@Getter
public enum DeviceTypeNameEnum {
SYS_ORDER_SERVICE_ITEM_GPS("sys_order_service_item_gps", "有线GPS"),
SYS_ORDER_SERVICE_ITEM_GPS_WIRELESS("sys_order_service_item_gps_wireless", "无线GPS"),
SYS_ORDER_SERVICE_ITEM_GPS_GT700F("sys_order_service_item_gps_GT700F", "先锋700F"),
DSC_ORDER_SERVICE_ITEM_WIRED("sys_order_service_item_wireline_dasouche", "大搜车有源");
private final String type;
private final String name;
DeviceTypeNameEnum(String type, String name) {
this.type = type;
this.name = name;
}
public static String getTypeByName(String Name) {
for (DeviceTypeNameEnum typeNameEnum : DeviceTypeNameEnum.values()) {
if (typeNameEnum.getName().equals(Name)) {
return typeNameEnum.getType();
}
}
return "--";
}
}
......@@ -52,4 +52,6 @@ public interface SysAreaMapper {
* @return
*/
List<FullAreaAndIdDto> getFullAreaAndAreaId();
SysArea getAreaByAreaName(@Param("areaName") String areaName);
}
......@@ -26,9 +26,9 @@ public interface SysIndentMapper {
Integer getSendDeviceNum(@Param("userId") Integer userId, @Param("deviceType")String deviceType);
/**
*
* @author zhanghj
* @Title: getIndentListByPage
*
* @author zhanghj
* @Title: getIndentListByPage
* @Description: TODO 分页获取订货单列表
* @param indent
* @return
......@@ -41,9 +41,9 @@ public interface SysIndentMapper {
SysIndent getByIndentNo(String indentNo);
/**
*
* @author zhanghj
* @Title: getDetail
*
* @author zhanghj
* @Title: getDetail
* @Description: TODO 获取订货单详情
* @param id
* @return
......@@ -64,9 +64,9 @@ public interface SysIndentMapper {
SysIndent getByUserIdAndDeviceNo(@Param("userId")int userId, @Param("deviceNo")String deviceNo);
/**
*
* @author zhanghj
* @Title: getMechanicIndentList
*
* @author zhanghj
* @Title: getMechanicIndentList
* @Description: TODO 获取技工端订货单列表
* @param indent
* @return
......@@ -76,9 +76,9 @@ public interface SysIndentMapper {
List<SysIndent> getMechanicIndentList(SysIndent indent);
/**
*
* @author zhanghj
* @Title: getSPIndentList
*
* @author zhanghj
* @Title: getSPIndentList
* @Description: TODO 获取服务商端订货单列表
* @param indent
* @return
......@@ -88,9 +88,9 @@ public interface SysIndentMapper {
List<SysIndent> getSPIndentList(SysIndent indent);
/**
*
* @author zhanghj
* @Title: getMechanicIndentListByPage
*
* @author zhanghj
* @Title: getMechanicIndentListByPage
* @Description: TODO 获取服务商下技工订货单列表
* @param indent
* @return
......@@ -104,4 +104,6 @@ public interface SysIndentMapper {
Integer updateIndentStatusByIds(List<Integer> ids);
SysIndent selectByIndentNo(String indentNo);
SysIndent getIndentByExpressAndDeviceType(@Param("expressSn") String expressSn, @Param("deviceType") String deviceType, @Param("expressCompany") String expressCompany);
}
\ No newline at end of file
......@@ -30,4 +30,6 @@ public interface SysLogisticsMapper {
int updateByPrimaryKey(SysLogistics record);
List<SysLogistics> listSysLogistics();
SysLogistics selectByExpressCompany(@Param("expressCompany") String expressCompany);
}
\ No newline at end of file
package com.glsx.ordercenter.mapper;
import com.glsx.ordercenter.pojo.user.SysManager;
import org.apache.ibatis.annotations.Param;
public interface SysManagerMapper {
int deleteByPrimaryKey(Integer id);
......@@ -17,4 +18,11 @@ public interface SysManagerMapper {
SysManager selectByUserId(Integer userId);
/**
* 通过服务商用户名获取服务商
*
* @param providerName 服务商用户名
* @return 服务商
*/
SysManager selectByProviderName(@Param("providerName") String providerName);
}
\ No newline at end of file
......@@ -44,4 +44,6 @@ public interface SysMechanicMapper {
List<MechanicBusiness> getMechanicListOrderByTimeliness(@Param("keyWord") String keyWord,
@Param("latitude") String latitude, @Param("longitude") String longitude,
@Param("userId") Integer userId);
SysMechanic selectByMechanicName(@Param("mechanicName") String mechanicName);
}
......@@ -39,4 +39,6 @@ public interface SysUserMapper {
* @return
*/
List<SysUser> selectByIdList(@Param("shopIdList") Set<Integer> shopIdList);
SysUser checkProviderAndMechanicMatch(@Param("providerUserId") Integer providerUserId, @Param("mechanicUserId") Integer mechanicUserId);
}
\ No newline at end of file
package com.glsx.ordercenter.pojo.user;
import lombok.Data;
@Data
public class SysMechanic {
private Integer id;
......@@ -25,117 +29,5 @@ public class SysMechanic {
private Integer generateCheckSheet;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getDistrict() {
return district;
}
public void setDistrict(Integer district) {
this.district = district;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
public String getWorkTimeStart() {
return workTimeStart;
}
public void setWorkTimeStart(String workTimeStart) {
this.workTimeStart = workTimeStart == null ? null : workTimeStart.trim();
}
public String getWorkTimeEnd() {
return workTimeEnd;
}
public void setWorkTimeEnd(String workTimeEnd) {
this.workTimeEnd = workTimeEnd == null ? null : workTimeEnd.trim();
}
public Byte getDispatchType() {
return dispatchType;
}
public void setDispatchType(Byte dispatchType) {
this.dispatchType = dispatchType;
}
public Byte getServiceType() {
return serviceType;
}
public void setServiceType(Byte serviceType) {
this.serviceType = serviceType;
}
public String getIdcard() {
return idcard;
}
public void setIdcard(String idcard) {
this.idcard = idcard == null ? null : idcard.trim();
}
public String getMechanicStatus() {
return mechanicStatus;
}
public void setMechanicStatus(String mechanicStatus) {
this.mechanicStatus = mechanicStatus;
}
public Integer getWorkStatus() {
return workStatus;
}
public void setWorkStatus(Integer workStatus) {
this.workStatus = workStatus;
}
public Integer getGenerateCheckSheet() {
return generateCheckSheet;
}
public void setGenerateCheckSheet(Integer generateCheckSheet) {
this.generateCheckSheet = generateCheckSheet;
}
@Override
public String toString() {
return "SysMechanic{" +
"id=" + id +
", userId=" + userId +
", district=" + district +
", address='" + address + '\'' +
", workTimeStart='" + workTimeStart + '\'' +
", workTimeEnd='" + workTimeEnd + '\'' +
", dispatchType=" + dispatchType +
", serviceType=" + serviceType +
", idcard='" + idcard + '\'' +
", mechanicStatus='" + mechanicStatus + '\'' +
", workStatus=" + workStatus +
", generateCheckSheet=" + generateCheckSheet +
'}';
}
private Integer sendType;
}
......@@ -405,4 +405,6 @@ public interface IOrderService {
void syncDismantleOrder(Integer orderId);
Map<String, Object> checkVinAndSn(Integer orderId, Integer serviceItemId);
Integer getPhotoConfigFlag();
}
......@@ -6,182 +6,172 @@ import javax.servlet.http.HttpServletRequest;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.Page;
import com.glsx.ordercenter.dto.imports.DeviceAndIndentImport;
import com.glsx.ordercenter.dto.IndentImportDeviceReq;
import com.glsx.ordercenter.dto.IndentImportDeviceResponse;
import com.glsx.ordercenter.mapper.SysOrderServiceTypeMapper;
import com.glsx.ordercenter.pojo.SysIndent;
import com.glsx.ordercenter.pojo.SysIndentLog;
import com.glsx.ordercenter.pojo.SysIndentLogistics;
import com.glsx.ordercenter.pojo.SysLogistics;
import com.glsx.ordercenter.pojo.user.SysManager;
import com.glsx.ordercenter.pojo.user.SysMechanic;
import org.springframework.web.multipart.MultipartFile;
/**
*
* @author zhanghj
* @version 1.0.0
* @Title IndentService.java
* @Package com.glsx.ordercenter.service
* @Description TODO 订货单service
* @author zhanghj
* @date 2019年6月3日 下午5:37:00
* @version 1.0.0
*/
public interface IndentService {
/**
*
* @author zhanghj
* @param request
* @Title: add
* @Description: TODO 增加订货单
* @param indent
* @return
* ResultObject
*
*/
ResultObject add(HttpServletRequest request, SysIndent indent);
/**
*
* @author zhanghj
* @Title: update
* @Description: TODO 编辑订货单
* @param indent
* @return
* ResultObject
*
*/
ResultObject update(SysIndent indent);
/**
*
* @author duanht
* @Title: sendDevice
* @Description: TODO 服务商发货
* @param request,sysIndentLogistics
*
*/
Integer sendDevice(HttpServletRequest request,SysIndentLogistics sysIndentLogistics);
/**
*
* @author duanht
* @Title: checkDevice
* @Description: TODO 订货单审核通过
*
*/
int checkIndent(Integer id,Integer userId);
/**
*
* @author duanht
* @Title: selectByPrimaryKey
* @Description: TODO 根据id查订货单信息
*
*/
SysIndent selectByPrimaryKey(Integer id);
/**
*
* @author zhanghj
* @Title: getIndentListByPage
* @Description: TODO 分页获取库存列表
* @param page
* @param indent
* @return
* List<SysOrder>
*
*/
List<SysIndent> getIndentListByPage(Page page, SysIndent indent);
/**
* @param request
* @param indent
* @return ResultObject
* @author zhanghj
* @Title: add
* @Description: TODO 增加订货单
*/
ResultObject add(HttpServletRequest request, SysIndent indent);
/**
* @param indent
* @return ResultObject
* @author zhanghj
* @Title: update
* @Description: TODO 编辑订货单
*/
ResultObject update(SysIndent indent);
/**
* @param request,sysIndentLogistics
* @author duanht
* @Title: sendDevice
* @Description: TODO 服务商发货
*/
Integer sendDevice(HttpServletRequest request, SysIndentLogistics sysIndentLogistics);
/**
* @author duanht
* @Title: checkDevice
* @Description: TODO 订货单审核通过
*/
int checkIndent(Integer id, Integer userId);
/**
* @author duanht
* @Title: selectByPrimaryKey
* @Description: TODO 根据id查订货单信息
*/
SysIndent selectByPrimaryKey(Integer id);
/**
* @param page
* @param indent
* @return List<SysOrder>
* @author zhanghj
* @Title: getIndentListByPage
* @Description: TODO 分页获取库存列表
*/
List<SysIndent> getIndentListByPage(Page page, SysIndent indent);
List<SysIndentLog> listIndentLog(String indentId);
SysIndent getByIndentNo(String indentNo);
/**
*
* @author zhanghj
* @Title: getDetail
* @param id
* @return SysIndent
* @author zhanghj
* @Title: getDetail
* @Description: TODO 获取订货单详情
*/
SysIndent getDetail(Integer id);
/**
* @param request
* @param id
* @return
* SysIndent
* @return ResultObject
* @author zhanghj
* @Title: cancel
* @Description: TODO 取消订货单
*/
ResultObject cancel(HttpServletRequest request, Integer id, Integer terminalType);
/**
* @param request
* @param page
* @param indent
* @return List<SysIndent>
* @author zhanghj
* @Title: getIndentListByTerminalType
* @Description: TODO 小程序端获取订货单列表
*/
List<SysIndent> getIndentListByTerminalType(HttpServletRequest request, Page page, SysIndent indent);
/**
* @param request
* @param id
* @return ResultObject
* @author zhanghj
* @Title: isConfirmReceipt
* @Description: TODO 查询是否确认收货
*/
ResultObject isConfirmReceipt(HttpServletRequest request, Integer id);
/**
* @param request
* @param id
* @return ResultObject
* @author zhanghj
* @Title: confirmReceipt
* @Description: TODO 确认收货
*/
ResultObject confirmReceipt(HttpServletRequest request, Integer id, Integer currentUserId);
/**
* @param request
* @param page
* @param indent
* @return List<SysIndent>
* @author zhanghj
* @Title: getMechanicIndentListByPage
* @Description: TODO 获取服务商下技工订货单列表
*/
List<SysIndent> getMechanicIndentListByPage(HttpServletRequest request, Page page, SysIndent indent);
List<IndentImportDeviceReq> getImportDeviceDetail(Page page, Integer indentId, String deviceNo);
Boolean deleteIndentImportDeviceById(Integer id);
IndentImportDeviceResponse checkImportIndentDevice(MultipartFile file);
List<String> getDeviceNoList(String indentNo);
void addIndentDeviceLog(Integer id, Integer indentStatus, String remark, Integer createBy);
/**
* 批量导入设备和订货单
*
* @param importList 设备和订货单数据
* @return
*/
SysIndent getDetail(Integer id);
/**
*
* @author zhanghj
* @param request
* @Title: cancel
* @Description: TODO 取消订货单
* @param id
* @return
* ResultObject
*
*/
ResultObject cancel(HttpServletRequest request, Integer id, Integer terminalType);
/**
*
* @author zhanghj
* @param request
* @Title: getIndentListByTerminalType
* @Description: TODO 小程序端获取订货单列表
* @param page
* @param indent
* @return
* List<SysIndent>
*
*/
List<SysIndent> getIndentListByTerminalType(HttpServletRequest request, Page page, SysIndent indent);
/**
*
* @author zhanghj
* @Title: isConfirmReceipt
* @Description: TODO 查询是否确认收货
* @param request
* @param id
* @return
* ResultObject
*
*/
ResultObject isConfirmReceipt(HttpServletRequest request, Integer id);
/**
*
* @author zhanghj
* @Title: confirmReceipt
* @Description: TODO 确认收货
* @param request
* @param id
* @return
* ResultObject
*
*/
ResultObject confirmReceipt(HttpServletRequest request, Integer id, Integer currentUserId);
/**
*
* @author zhanghj
* @Title: getMechanicIndentListByPage
* @Description: TODO 获取服务商下技工订货单列表
* @param request
* @param page
* @param indent
* @return
* List<SysIndent>
*
*/
List<SysIndent> getMechanicIndentListByPage(HttpServletRequest request,
Page page, SysIndent indent);
List<IndentImportDeviceReq> getImportDeviceDetail(Page page, Integer indentId, String deviceNo);
Boolean deleteIndentImportDeviceById(Integer id);
IndentImportDeviceResponse checkImportIndentDevice(MultipartFile file);
List<String> getDeviceNoList(String indentNo);
void addIndentDeviceLog(Integer id, Integer indentStatus, String remark, Integer createBy);
List<DeviceAndIndentImport> batchDeviceAndIndentImport(List<DeviceAndIndentImport> importList, Integer userId);
Integer countImportDeviceByDeviceNo(String sn);
Integer countDeviceByDeviceNo(String sn);
SysManager checkProviderName(String providerName);
SysMechanic checkMechanicName(String mechanicName);
boolean checkProviderAndMechanicMatch(Integer providerUserId, Integer MechanicUserId);
SysLogistics checkExpressCompany(String expressCompany);
}
......@@ -3820,6 +3820,12 @@ public class OrderServiceImpl implements IOrderService {
// ResultCodeEnum.DISTANCE_RESERVE_TIME_ONE_HOUR.getMsg());
// }
// }
// 校验工单状态
if (OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_CANCEL.getActiveStatus() == order.getCanceled()) {
return new ResultObject(ResultCodeEnum.ORDER_CANCELED_RERESH_LIST.getCode(), ResultCodeEnum.ORDER_CANCELED_RERESH_LIST.getMsg());
} else if (OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_FINISH.getActiveStatus() == order.getActiveStatus()) {
return new ResultObject(ResultCodeEnum.ORDER_FINISH.getCode(), ResultCodeEnum.ORDER_FINISH.getMsg());
}
SysOrder sysOrder = new SysOrder();
sysOrder.setId(id);
sysOrder.setActiveStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_NOT_FINISH.getActiveStatus());
......@@ -4312,7 +4318,7 @@ public class OrderServiceImpl implements IOrderService {
return new ResultObject(ResultCodeEnum.DEVICE_BELONG_USER.getCode(), ResultCodeEnum.DEVICE_BELONG_USER.getMsg());
}
//扣减库存
reduceStock(orderDeviceList,userId);
reduceStock(orderDeviceList, userId);
//保存数据
boolean isAudit = (item.getIsAudit() == 1 || order.getAuditStatus() != -1);
......@@ -4328,19 +4334,19 @@ public class OrderServiceImpl implements IOrderService {
return resultObject;
}
private void reduceStock(List<SysOrderDevice> orderDeviceList, int userId){
private void reduceStock(List<SysOrderDevice> orderDeviceList, int userId) {
try {
List<String> list = orderDeviceList.stream().map(SysOrderDevice::getDeviceNo).collect(Collectors.toList());
SysDeviceExample deviceExample = new SysDeviceExample();
deviceExample.createCriteria().andUserIdEqualTo(userId).andDeviceStatusEqualTo(Constants.DEVICE_STATUS_NO_ACTIVE).andDeviceNoIn(list);
List<SysDevice> sysDevices = deviceMapper.selectByExample(deviceExample);
if (sysDevices.isEmpty()){
if (sysDevices.isEmpty()) {
return;
}
for (SysDevice device : sysDevices) {
//设备关联的订单未确认收货不允许激活(通过拆除或者检修入库的设备没有订货单,单号可以为空)
SysIndent sysIndent = indentMapper.getByUserIdAndDeviceNo(userId, device.getDeviceNo());
if (sysIndent == null){
if (sysIndent == null) {
continue;
}
if (sysIndent.getIndentStatus() != IndentStatusEnum.INDENT_COMPLETE.getIndentStatus()) {
......@@ -5431,4 +5437,13 @@ public class OrderServiceImpl implements IOrderService {
return resMap;
}
@Override
public Integer getPhotoConfigFlag() {
// 暂时废弃掉 不做开发
// 获取配置
// String flagStr = PropertiesUtil.getProperty("bhg.photo.config.flag", "1");
// return Integer.valueOf(flagStr);
return 1;
}
}
......@@ -195,4 +195,9 @@
LEFT JOIN sys_area sa1 ON sa.parent_id = sa1.id
LEFT JOIN sys_area sa2 ON sa1.parent_id = sa2.id
</select>
<select id="getAreaByAreaName" resultMap="BaseResultMap">
SELECT *
FROM sys_area
WHERE area_name = #{areaName} limit 1
</select>
</mapper>
......@@ -29,11 +29,11 @@
</association>
</resultMap>
<sql id="Base_Column_List">
id, indent_no, user_id, device_type, device_amount, indent_status, is_canceled, district_code,
id, indent_no, user_id, device_type, device_amount, indent_status, is_canceled, district_code,
address, remark, create_by, create_time, update_by, update_time,phone
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from sys_indent
where id = #{id,jdbcType=INTEGER}
......@@ -46,17 +46,17 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_indent (indent_no, send_type, user_id,
device_type, device_amount, indent_status,
is_canceled, phone, receiver_name,
district_code, address, remark,
create_by, create_time, update_by,
insert into sys_indent (indent_no, send_type, user_id,
device_type, device_amount, indent_status,
is_canceled, phone, receiver_name,
district_code, address, remark,
create_by, create_time, update_by,
update_time)
values (#{indentNo,jdbcType=VARCHAR}, #{sendType,jdbcType=TINYINT}, #{userId,jdbcType=INTEGER},
#{deviceType,jdbcType=VARCHAR}, #{deviceAmount,jdbcType=INTEGER}, #{indentStatus,jdbcType=INTEGER},
#{isCanceled,jdbcType=TINYINT}, #{phone,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR},
#{districtCode,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER},
values (#{indentNo,jdbcType=VARCHAR}, #{sendType,jdbcType=TINYINT}, #{userId,jdbcType=INTEGER},
#{deviceType,jdbcType=VARCHAR}, #{deviceAmount,jdbcType=INTEGER}, #{indentStatus,jdbcType=INTEGER},
#{isCanceled,jdbcType=TINYINT}, #{phone,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR},
#{districtCode,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysIndent">
......@@ -171,7 +171,7 @@
</if>
</trim>
</insert>
<select id="getIndentCount" parameterType="com.glsx.ordercenter.pojo.SysIndent" resultType="java.lang.Integer">
select count(*) from sys_indent
<where>
......@@ -270,7 +270,7 @@
where ssm.service_id = #{userId}
);
</select>
<select id="getIndentListByPage" parameterType="com.glsx.ordercenter.pojo.SysIndent" resultMap="BaseResultMap">
<if test="username != null and username != ''">
<bind name="username" value="'%' + username + '%'"/>
......@@ -281,9 +281,9 @@
<if test="endDate != null and endDate != ''">
<bind name="endDate" value="endDate + ' 23:59'"/>
</if>
select
select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.receiver_name, si.district_code, si.address, si.remark, si.indent_type,
si.create_by, si.create_time, si.update_by, si.update_time,
su.username,su.name,su.user_type,
......@@ -315,7 +315,7 @@
<select id="getByIndentNo" resultMap="BaseResultMap">
SELECT * from sys_indent WHERE indent_no=#{indentNo}
</select>
<resultMap id="detailResultMap" type="com.glsx.ordercenter.pojo.SysIndent">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="indent_no" jdbcType="VARCHAR" property="indentNo" />
......@@ -353,9 +353,9 @@
</association>
</resultMap>
<select id="getDetail" parameterType="java.lang.Integer" resultMap="detailResultMap">
select
select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.receiver_name, si.district_code, si.address, si.remark,
si.create_by, si.create_time, si.update_by, si.update_time,si.indent_type,
su.username,su.name,su.user_type,
......@@ -384,14 +384,14 @@
LEFT JOIN sys_device sd ON s.indent_no = sd.indent_no
where sd.user_id = #{userId} AND sd.device_no = #{deviceNo}
</select>
<select id="getMechanicIndentList" parameterType="com.glsx.ordercenter.pojo.SysIndent" resultMap="BaseResultMap">
<if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'"/>
</if>
select
select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.receiver_name, si.district_code, si.address, si.remark,
si.create_by, si.create_time, si.update_by, si.update_time,si.indent_type,
su.username,
......@@ -419,14 +419,14 @@
</where>
ORDER BY si.create_time desc, si.id DESC
</select>
<select id="getSPIndentList" parameterType="com.glsx.ordercenter.pojo.SysIndent" resultMap="BaseResultMap">
<if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'"/>
</if>
select
select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.receiver_name, si.district_code, si.address, si.remark,
si.create_by, si.create_time, si.update_by, si.update_time,si.indent_type,
su.username,
......@@ -453,16 +453,16 @@
</if>
</where>
ORDER BY si.create_time DESC, si.id DESC
</select>
<select id="getMechanicIndentListByPage" parameterType="com.glsx.ordercenter.pojo.SysIndent" resultMap="BaseResultMap">
<if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'"/>
</if>
select
select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.receiver_name, si.district_code, si.address, si.remark,
si.create_by, si.create_time, si.update_by, si.update_time,
su.username, su.name, su.phone_number,
......@@ -515,4 +515,13 @@
from sys_indent
where indent_no = #{indentNo}
</select>
<select id="getIndentByExpressAndDeviceType" resultMap="BaseResultMap">
SELECT si.*
FROM sys_indent si
LEFT JOIN sys_indent_logistics sil ON sil.indent_id = si.id
WHERE sil.logistics_no = #{expressSn}
and si.device_type = #{deviceType}
and sil.logistics_unicode = #{expressCompany}
</select>
</mapper>
\ No newline at end of file
......@@ -83,7 +83,7 @@
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
select
<include refid="Base_Column_List" />
from sys_logistics
where id = #{id,jdbcType=INTEGER}
......@@ -99,9 +99,9 @@
</if>
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysLogistics" >
insert into sys_logistics (id, express_company, unicode,
insert into sys_logistics (id, express_company, unicode,
charact_type)
values (#{id,jdbcType=INTEGER}, #{expressCompany,jdbcType=VARCHAR}, #{unicode,jdbcType=VARCHAR},
values (#{id,jdbcType=INTEGER}, #{expressCompany,jdbcType=VARCHAR}, #{unicode,jdbcType=VARCHAR},
#{charactType,jdbcType=CHAR})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysLogistics" >
......@@ -202,4 +202,16 @@
BINARY charact_type,
uniCODE ASC;
</select>
<select id="selectByExpressCompany" resultMap="BaseResultMap">
SELECT
*
FROM
sys_logistics
WHERE
express_company = #{expressCompany}
ORDER BY
BINARY charact_type,
uniCODE ASC;
</select>
</mapper>
\ No newline at end of file
......@@ -11,11 +11,11 @@
<result column="address_code" jdbcType="INTEGER" property="addressCode" />
<result column="IDCard" jdbcType="VARCHAR" property="idcard" />
<result column="bank_card_no" jdbcType="VARCHAR" property="bankCardNo" />
<result column="bank_name" jdbcType="VARCHAR" property="bankName" />
<result column="bank_name" jdbcType="VARCHAR" property="bankName" />
<result column="generate_check_sheet" jdbcType="INTEGER" property="generateCheckSheet" />
</resultMap>
<sql id="Base_Column_List">
id, user_id, mail, occupation, provider_name, address_detail, address_code, IDCard,
id, user_id, mail, occupation, provider_name, address_detail, address_code, IDCard,
bank_card_no, bank_name, generate_check_sheet
</sql>
......@@ -29,23 +29,31 @@
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from sys_manager
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByProviderName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_manager
where provider_name=#{providerName}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_manager
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.ordercenter.pojo.user.SysManager" useGeneratedKeys="true">
insert into sys_manager (user_id, mail, occupation,
provider_name, address_detail, address_code,
IDCard, bank_card_no, bank_name,
insert into sys_manager (user_id, mail, occupation,
provider_name, address_detail, address_code,
IDCard, bank_card_no, bank_name,
generate_check_sheet)
values (#{userId,jdbcType=INTEGER}, #{mail,jdbcType=VARCHAR}, #{occupation,jdbcType=VARCHAR},
#{providerName,jdbcType=VARCHAR}, #{addressDetail,jdbcType=VARCHAR}, #{addressCode,jdbcType=INTEGER},
#{idcard,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR},
values (#{userId,jdbcType=INTEGER}, #{mail,jdbcType=VARCHAR}, #{occupation,jdbcType=VARCHAR},
#{providerName,jdbcType=VARCHAR}, #{addressDetail,jdbcType=VARCHAR}, #{addressCode,jdbcType=INTEGER},
#{idcard,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR},
#{generateCheckSheet,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.ordercenter.pojo.user.SysManager" useGeneratedKeys="true">
......@@ -77,7 +85,7 @@
</if>
<if test="bankName != null">
bank_name,
</if>
</if>
<if test="generateCheckSheet != null">
generate_check_sheet,
</if>
......@@ -109,7 +117,7 @@
</if>
<if test="bankName != null">
#{bankName,jdbcType=VARCHAR},
</if>
</if>
<if test="generateCheckSheet != null">
#{generateCheckSheet,jdbcType=INTEGER},
</if>
......@@ -144,7 +152,7 @@
</if>
<if test="bankName != null">
bank_name = #{bankName,jdbcType=VARCHAR},
</if>
</if>
<if test="generateCheckSheet != null">
generate_check_sheet = #{generateCheckSheet,jdbcType=INTEGER},
</if>
......@@ -161,7 +169,7 @@
address_code = #{addressCode,jdbcType=INTEGER},
IDCard = #{idcard,jdbcType=VARCHAR},
bank_card_no = #{bankCardNo,jdbcType=VARCHAR},
bank_name = #{bankName,jdbcType=VARCHAR},
bank_name = #{bankName,jdbcType=VARCHAR},
generate_check_sheet = #{generateCheckSheet,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
......
......@@ -15,6 +15,7 @@
<result column="mechanic_status" jdbcType="TINYINT" property="mechanicStatus"/>
<result column="work_status" jdbcType="TINYINT" property="workStatus"/>
<result column="generate_check_sheet" jdbcType="INTEGER" property="generateCheckSheet"/>
<result column="send_type" jdbcType="INTEGER" property="sendType"/>
</resultMap>
<sql id="Example_Where_Clause">
......@@ -545,4 +546,13 @@
GROUP BY u.id
order by timeliness is null, timeliness ASC
</select>
<select id="selectByMechanicName" resultMap="BaseResultMap">
select
sm.id, sm.user_id, sm.district, sm.address, sm.work_time_start, sm.work_time_end, sm.dispatch_type, sm.service_type,
sm.IDCard, sm.mechanic_status
from sys_mechanic sm
left join sys_user su on sm.user_id = su.id
where su.name = #{mechanicName}
</select>
</mapper>
......@@ -293,6 +293,14 @@
</where>
</select>
<select id="checkProviderAndMechanicMatch" resultMap="BaseResultMap">
SELECT su.*
FROM sys_service_mechanic ssm
LEFT JOIN sys_user su ON ssm.mechanic_id = su.id
WHERE ssm.service_id = #{providerUserId}
and ssm.mechanic_id = #{mechanicUserId}
</select>
<update id="updateActualPhoneNumberByUserId">
UPDATE sys_user
SET actual_phone_number = #{actualPhoneNumber}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!