Commit 1bc7e976640796bf91f5c227cc44502cb6f7de87
1 parent
8526b84d
车辆加油导入excel添加驾驶员工号一列
Showing
3 changed files
with
13 additions
and
11 deletions
src/main/java/com/bsth/repository/oil/CwjyRepository.java
| ... | ... | @@ -40,14 +40,15 @@ public interface CwjyRepository extends BaseRepository<Cwjy, Integer>{ |
| 40 | 40 | @Transactional |
| 41 | 41 | @Modifying |
| 42 | 42 | @Query(value="INSERT INTO bsth_c_ylxxb("+ |
| 43 | - "gsdm, yyrq, nbbm, jzl, stationid, bz, createtime, nylx, jylx)" + | |
| 44 | - " VALUES(" + | |
| 45 | - "?1,str_to_date(?2,'%Y-%m-%d'),?3,?4,?5,?6,str_to_date(?7,'%Y-%m-%d %H:%i:%s'), '0', '1') ", nativeQuery=true) | |
| 46 | - void import_insertData(String gsbm, String rq, String nbbm, String jzl, String jyz, String remarks, String createtime); | |
| 43 | + "gsdm, yyrq, nbbm, jsy, jzl, stationid, bz, createtime, nylx, jylx) " + | |
| 44 | + "VALUES(" + | |
| 45 | + "?1,str_to_date(?2,'%Y-%m-%d'),?3,?4,?5,?6,?7,str_to_date(?8,'%Y-%m-%d %H:%i:%s'), '0', '1') ", nativeQuery=true) | |
| 46 | + void import_insertData(String gsbm, String rq, String nbbm, String jsy, String jzl, String jyz, String remarks, String createtime); | |
| 47 | 47 | |
| 48 | 48 | @Transactional |
| 49 | 49 | @Modifying |
| 50 | - @Query(value="UPDATE bsth_c_ylxxb set jzl = ?1 where gsdm = ?2 and yyrq = ?3 and nbbm = ?4 and jylx = '1' ",nativeQuery=true) | |
| 51 | - void import_UpdateJzl(String jdl, String gsbm, String rq, String nbbm); | |
| 50 | + @Query(value="UPDATE bsth_c_ylxxb set jzl = ?1, jsy = ?2, stationid = ?3, bz = ?4 " | |
| 51 | + + "where gsdm = ?5 and yyrq = ?6 and nbbm = ?7 and jylx = '1' ",nativeQuery=true) | |
| 52 | + void import_UpdateJzl(String jzl, String jsy, String jyz, String remarks, String gsbm, String rq, String nbbm); | |
| 52 | 53 | |
| 53 | 54 | } | ... | ... |
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
| ... | ... | @@ -511,9 +511,10 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 511 | 511 | String[] split = text.split(","); |
| 512 | 512 | String rq = split[0].trim(); |
| 513 | 513 | String nbbm = split[1].trim(); |
| 514 | - double jzl = Double.valueOf(split[2].trim().length()!=0?split[2]:"0"); | |
| 515 | - String jyz = split[3].trim(); | |
| 516 | - String remarks = split[4].trim(); | |
| 514 | + String jsy = split[2].trim(); | |
| 515 | + double jzl = Double.valueOf(split[3].trim().length()!=0?split[3]:"0"); | |
| 516 | + String jyz = split[4].trim(); | |
| 517 | + String remarks = split[5].trim(); | |
| 517 | 518 | if(rq.trim().length() == 0){ |
| 518 | 519 | rq = sdf.format(new Date()); |
| 519 | 520 | } |
| ... | ... | @@ -521,10 +522,10 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 521 | 522 | List<Double> jzl_ = repository.import_queryBySame(gsbm, rq, nbbm); |
| 522 | 523 | // |
| 523 | 524 | if(jzl_.size() == 0){ |
| 524 | - repository.import_insertData(gsbm, rq, nbbm, | |
| 525 | + repository.import_insertData(gsbm, rq, nbbm, jsy, | |
| 525 | 526 | df.format(jzl), jyz, remarks, sd.format(new Date())); |
| 526 | 527 | }else{ |
| 527 | - repository.import_UpdateJzl(df.format(jzl), gsbm, rq, nbbm); | |
| 528 | + repository.import_UpdateJzl(df.format(jzl), jsy, jyz, remarks, gsbm, rq, nbbm); | |
| 528 | 529 | } |
| 529 | 530 | } |
| 530 | 531 | wb.close(); | ... | ... |
src/main/resources/static/pages/forms/export/import_Jygl.xls
No preview for this file type