Sfoglia il codice sorgente

Merge branch 'master' of shikejing/guns-separation into master

shikejing 4 anni fa
parent
commit
3ed2a86a89

+ 9 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlBasicInfoController.java

@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
/***
 * @ClassName: ZjxlBasicInfoController
@ -48,6 +49,14 @@ public class ZjxlBasicInfoController extends BaseController {
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
            basicInfo.setBasicInfoCreateTime(df.format(new Date()));// new Date()为获取当前系统时间
            Iterable<ZjxlBasicInfo> iterable = basicInfoService.findBasicInfo(null);
            if (basicInfoTel.length() > 0){
                Iterator<ZjxlBasicInfo> iterator = iterable.iterator();
                while (iterator.hasNext()){
                    basicInfoService.deleteBasicInfo(iterator.next().getBasicInfoId());
                }
            }
            return write(200,"编辑成功","data",basicInfoService.addBasicInfo(basicInfo));
        }catch (Exception e){
            e.printStackTrace();

+ 4 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/service/ZjxlBasicInfoService.java

@ -36,4 +36,8 @@ public class ZjxlBasicInfoService extends BaseService {
        Iterable<ZjxlBasicInfo> infoIterable = basicInfoDao.findAll();
        return infoIterable;
    }
    public void deleteBasicInfo(String basicInfoId){
        basicInfoDao.deleteById(basicInfoId);
    }
}