
5 changed files with 149 additions and 5 deletions
@ -0,0 +1,80 @@ |
|||
package com.yxt.supervise.customer.biz.csmcash; |
|||
|
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.domain.EntityWithId; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@TableName("csm_cash_gd") |
|||
public class CsmCashGd extends EntityWithId { |
|||
|
|||
private String sid = IdUtil.fastSimpleUUID(); // sid
|
|||
@JsonFormat( |
|||
pattern = "yyyy-MM-dd HH:mm:ss", |
|||
timezone = "GMT+8" |
|||
) |
|||
private Date createTime = new Date(); // 记录创建时间
|
|||
private String remarks; // 备注信息
|
|||
private int status = 0; // 状态:0=f未核对,1=已核对(核对后数据不可再更改)
|
|||
private String dataDate; // 日期
|
|||
private String accountName; // 账户名称
|
|||
private double accountAmount; // 金额
|
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public Date getCreateTime() { |
|||
return createTime; |
|||
} |
|||
|
|||
public void setCreateTime(Date createTime) { |
|||
this.createTime = createTime; |
|||
} |
|||
|
|||
public String getRemarks() { |
|||
return remarks; |
|||
} |
|||
|
|||
public void setRemarks(String remarks) { |
|||
this.remarks = remarks; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getDataDate() { |
|||
return dataDate; |
|||
} |
|||
|
|||
public void setDataDate(String dataDate) { |
|||
this.dataDate = dataDate; |
|||
} |
|||
|
|||
public String getAccountName() { |
|||
return accountName; |
|||
} |
|||
|
|||
public void setAccountName(String accountName) { |
|||
this.accountName = accountName; |
|||
} |
|||
|
|||
public double getAccountAmount() { |
|||
return accountAmount; |
|||
} |
|||
|
|||
public void setAccountAmount(double accountAmount) { |
|||
this.accountAmount = accountAmount; |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
package com.yxt.supervise.customer.biz.csmcash; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CsmCashGdMapper extends BaseMapper<CsmCashGd> { |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.yxt.supervise.customer.biz.csmcash; |
|||
|
|||
import cn.hutool.poi.excel.ExcelReader; |
|||
import cn.hutool.poi.excel.ExcelUtil; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import com.yxt.common.base.config.component.FileUploadComponent; |
|||
import com.yxt.common.core.result.FileUploadResult; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class CsmCashGdService extends ServiceImpl<CsmCashGdMapper,CsmCashGd> { |
|||
|
|||
@Autowired |
|||
private FileUploadComponent fileUploadComponent; |
|||
|
|||
public ResultBean uploadAnd2Db(MultipartFile file) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
|
|||
ResultBean<FileUploadResult> fub = fileUploadComponent.uploadFile(file, "kcxxcx"); |
|||
String filePath = fub.getData().getFilePath(); |
|||
String fp = fileUploadComponent.getUploadPath() + filePath; |
|||
|
|||
ExcelReader reader = ExcelUtil.getReader(fp); |
|||
List<Map<String,Object>> readAll = reader.readAll(); |
|||
|
|||
|
|||
return rb.success(); |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.supervise.customer.biz.csmcash; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.supervise.customer.api.gdinventorylog.GdInventoryLog; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
@RestController("com.yxt.supervise.customer.biz.csmcash.CsmCashRest") |
|||
@RequestMapping("/csmcash") |
|||
public class CsmCashRest { |
|||
|
|||
@Autowired |
|||
private CsmCashGdService csmCashGdService; |
|||
|
|||
@PostMapping("/uploadGdData") |
|||
public ResultBean<GdInventoryLog> uploadGdData(@RequestParam("file") MultipartFile file) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
rb = csmCashGdService.uploadAnd2Db(file); |
|||
return rb; |
|||
} |
|||
} |
Loading…
Reference in new issue