别人调我写的接口可以返回所有数据但是上传服务器后再调接口就少了一个字段的信息是什么问题
19 回复
这是代码
@At
@Ok("raw:json")
public String jbxx(String pai, String gongsiNo, String caozuoyuan_xm) {
//pai = new String(pai .getBytes("iso8859-1"),"utf-8");
java.util.Calendar rightNow = java.util.Calendar.getInstance();
java.text.SimpleDateFormat sim = new java.text.SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
// 如果是后退几天,就写 -天数 例如:
rightNow.add(java.util.Calendar.DAY_OF_MONTH, -20);
// 进行时间转换
String date = sim.format(rightNow.getTime());
List<Work_pz_gzEntity> result = dao.query(
Work_pz_gzEntity.class,
Cnd.where("che_no", "=", pai).and("xche_jdrq", ">", date)
.and("flag_fast", "=", 0).and("mainstate", "=", -1)
.desc("xche_jdrq"));
System.out.println("=====jbxxjbxxjbxx===========jbxxjbxxjbxx==============");
if (result.size() == 0) {
String num = add(gongsiNo, caozuoyuan_xm);
Work_pz_gzEntity pz = new Work_pz_gzEntity();
pz.setWork_no(num);
pz.setChe_no(pai);
pz.setXche_jdrq(new Date());
// 查询建表需要的内容
List<feilvEntity> fei = dao.query(feilvEntity.class,
Cnd.where("feil_sy", "=", true));
if (fei.size() < 0) {
fei = dao.query(feilvEntity.class,
Cnd.where("feil_mc", "=", "一级标准"));
}
String mc = fei.get(0).getFeil_mc();
double fl = fei.get(0).getFeil_fl();
pz.setXche_sfbz(mc);
pz.setXche_sffl(fl);
pz.setFlag_fast(false);
pz.setMainstate(-1);
pz.setFlag_pad(true);
Work_cheliang_smEntity che = dao.fetch(Work_cheliang_smEntity.class, pai);
if(che!=null){
pz.setChe_cx(che.getChe_cx());
pz.setChe_vin(che.getChe_vin());
pz.setGcsj(che.getChe_gcrq());
pz.setXche_lc(che.getChe_next_licheng());
KehuEntity kehu = dao.fetch(KehuEntity.class,che.getKehu_no());
if(kehu!=null){
pz.setKehu_mc(kehu.getKehu_mc());
pz.setKehu_dh(kehu.getKehu_dh());
}
}else{
Work_cheliang_smEntity che_new = new Work_cheliang_smEntity();
che_new.setChe_no(pai);
dao.insert(che_new);
KehuEntity kehu = new KehuEntity();
kehu.setKehu_no(pai);
dao.insert(kehu);
}
int nu = dao.updateIgnoreNull(pz);
result = dao.query(Work_pz_gzEntity.class,
Cnd.where("che_no", "=", pai).and("xche_jdrq", ">", date)
.desc("xche_jdrq"));
}
for (Work_pz_gzEntity o : result) {
Work_cheliang_smEntity ss = dao.fetch(Work_cheliang_smEntity.class,
o.getChe_no());
if (ss != null)
o.setGcsj(ss.getChe_gcrq());
}
String json = Json.toJson(result, JsonFormat.full());
if (result.size() != 0) {
return jsons.json(1, result.size(), 1, json);
}
return jsons.json(1, result.size(), 0, json);
}
发来慰问
来自炫酷的 NutzCN
添加回复
请先登陆